public void addReactiveAgent() { ReactiveAgent ra = new ReactiveAgent(_gameManager, _game, _camera, _team + 1); playerList.Add(ra); Thread playerThread = new Thread(new ParameterizedThreadStart(ra.update)); playerThreads.Add(ra, playerThread); _team = (_team + 1) % 2; }
/* -------------------------- AGENTS --------------------------- */ public void newPlayerWithDisk(ReactiveAgent player) { player.removePlayerDisk(); _playerWithDisk = player; }
// Direction coordinates must be beetween 0 and 1 public void shoot(Vector2 direction) { displayState.Velocity = direction*_maxVelocity*5; _playerWithDisk = null; }
public bool sameTeam(ReactiveAgent agent) { if(agent != null) return agent.getTeam() == _team; return false; }