Represents the current state of an entity (Its position, velocity, etc)
Пример #1
0
        public EntityState SimulationState; //Current internal state (What the game sees)

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Creates a new base of a player
        /// </summary>
        public Player(Map map, Vector2 position, string name, int id)
        {
            Map = map;
            Smiley = SmileyType.Default;
            Mode = PlayerMode.Normal;
            Tint = Color.White;

            SimulationState = new EntityState();
            DisplayState = new EntityState();
            PreviousState = new EntityState();

            SimulationState.Position = PreviousState.Position = DisplayState.Position = position;

            if (id > byte.MaxValue)
                throw new ArgumentOutOfRangeException("id", id, "The player ID must be within range of a single byte.");
            ID = (byte)id;
            Username = name;

            Index = map.Players.Count;
        }