/// <summary> /// Create a new Player object. /// </summary> /// <param name="_tank">Tank identifying this player.</param> public Player(GameSession.Tank _tank) { tank = _tank; MovementDirection = VTankObject.Direction.NONE; RotationDirection = VTankObject.Direction.NONE; Angle = _tank.angle; Weapon = WeaponLoader.GetWeapon(tank.attributes.weaponID); }
/// <summary> /// Method helper for creating a known TankObject type from a VTankObject.Tank type. /// </summary> /// <param name="tank">Tank to convert.</param> /// <returns>Converted tank object.</returns> public static PlayerTank CreateTankObject(GameSession.Tank tank) { PlayerTank newTank = new PlayerTank( ServiceManager.Resources.GetModel("tanks\\" + tank.attributes.model), tank.attributes, new Vector3((float)tank.position.x, (float)tank.position.y, -1f), tank.attributes.health > 0, (float)tank.angle, tank.id, tank.team); return(newTank); }
public PlayerJoinedEvent(GamePlayState _game, GameSession.Tank tank) : base(_game) { this.tank = tank; }
/* * The following methods are implemented from the Slice interface. For documentation, see * the GameSession.ice file. */ #region Ice Methods #region Player public override void PlayerJoined(GameSession.Tank tank, Ice.Current current__) { buffer.Enqueue(new PlayerJoinedEvent(Game, tank)); }
public override void PlayerJoined(GameSession.Tank tank, Ice.Current current__) { buffer.Push(new PlayerJoinedEvent(bot, tank)); }
public override void Dispose() { tank = null; base.Dispose(); }
public PlayerJoinedEvent(VTankBot _game, GameSession.Tank tank) : base(_game) { this.tank = tank; }