Esempio n. 1
0
        /// <summary>
        /// constructor which takes old data and updates only Vectors
        /// </summary>
        /// <param name="oldPacket">old data</param>
        /// <param name="newPlayerPosition">new position</param>
        /// <param name="newPlayerMovementDirection">new velocity vector</param>
        /// <param name="newPlayerLookingDirection">new looking direction</param>
        public BasePlayerInfo(BasePlayerInfo oldPacket,
            Vector newPlayerPosition,
            Vector newPlayerMovementDirection,
            Vector newPlayerLookingDirection)
        {
            playerPositionField = new Vector(newPlayerPosition);
                playerMovementDirectionField = new Vector(newPlayerMovementDirection);
                playerLookingDirectionField = new Vector(newPlayerLookingDirection);

                //this.PacketId = (ushort)(oldPacket.PacketId + 1);
                this.playerCarringWeponOneField = oldPacket.playerCarringWeponOneField;
                this.playerCarringWeponTwoField = oldPacket.playerCarringWeponTwoField;
                this.playerDuckingField = oldPacket.playerDuckingField;
                this.playerIdField = oldPacket.playerIdField;
                this.playerJumpingField = oldPacket.playerJumpingField;
                //this.playerRunningField = oldPacket.playerRunningField;
                this.playerShootingField = oldPacket.playerShootingField;
                //this.playerWalkingField = oldPacket.playerWalkingField;
        }
Esempio n. 2
0
 public object Clone()
 {
     BasePlayerInfo copy = new BasePlayerInfo();
         copy.playerCarringWeponOneField = this.PlayerCarringWeponOne;
         copy.playerCarringWeponTwoField = this.playerCarringWeponTwoField;
         copy.playerDuckingField = this.playerDuckingField;
         copy.playerIdField = this.playerIdField;
         copy.playerJumpingField = this.playerJumpingField;
         copy.playerLookingDirectionField = (Vector)this.playerLookingDirectionField.Clone();
         copy.playerMovementDirectionField = (Vector)this.playerMovementDirectionField.Clone();
         copy.playerPositionField = (Vector)this.playerPositionField.Clone();
         copy.playerShootingField = this.playerShootingField;
         //copy.playerWalkingField = this.playerWalkingField;
         //copy.playerRunningField = this.playerRunningField;
         copy.AckRequiredField = this.AckRequiredField;
         return copy;
 }