예제 #1
0
 /// <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);
 }
예제 #2
0
 /// <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);
 }
예제 #3
0
        /// <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);
        }
예제 #4
0
 public PlayerJoinedEvent(GamePlayState _game, GameSession.Tank tank)
     : base(_game)
 {
     this.tank = tank;
 }
예제 #5
0
        /*
         * 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));
        }
예제 #6
0
 public override void PlayerJoined(GameSession.Tank tank, Ice.Current current__)
 {
     buffer.Push(new PlayerJoinedEvent(bot, tank));
 }
예제 #7
0
        public override void Dispose()
        {
            tank = null;

            base.Dispose();
        }
예제 #8
0
 public PlayerJoinedEvent(VTankBot _game, GameSession.Tank tank)
     : base(_game)
 {
     this.tank = tank;
 }
예제 #9
0
        public override void Dispose()
        {
            tank = null;

            base.Dispose();
        }
예제 #10
0
 public PlayerJoinedEvent(VTankBot _game, GameSession.Tank tank)
     : base(_game)
 {
     this.tank = tank;
 }
예제 #11
0
 public PlayerJoinedEvent(GamePlayState _game, GameSession.Tank tank)
     : base(_game)
 {
     this.tank = tank;
 }