private bool canSeePlayer(NPCWorldView.GameCharacter player) { var npc = this._npc; if (Vector3.Distance(npc.getPos(), player.getPos()) < 20) { return(true); } return(false); }
//==============Constructor================================================== public NPCBrain(NPCWorldView.GameCharacter npc, BlockingQueue <NPCThread.instruction> i, WorldGrid worldGrid) { this.npc = npc; this._state = new Stack <State>(); this._instructions = i; this._speed = 1.0f; this._worldGrid = worldGrid; this._state.Push(new Roam(this)); }
public State(NPCBrain x) { this._worldGrid = x._worldGrid; _npc = x.npc; this._brain = x; }