java - Reference Object Created at Runtime -


i have 2 classes: "player" , "armor". "player" contains generic variables expect find in rpg game. "armor" contains generic variables relevant armor.

in "armor" class, have method:

public boolean canequip() {      boolean tf = false;      if (this.wieldlevel <= [need code here]) {          tf = true;     } else         tf = false;      return tf; } 

i'm trying reference object wont created until player loads savefile or creates new game, @ point player object created. there way write method correctly?

if (this.wieldlevel <= player.getlevel()) //this doesn't seem work. 

as ashwin says, player should parameter canequip() function.

public boolean canequip (player player) {     return (player.getlevel() >= wieldlevel); } 

Comments