Ejemplo n.º 1
0
        /// <summary>Restore the entity's state to that of the snapshot</summary>
        public virtual void RestoreSnapshot(IStatefulSnapshot snapshot)
        {
            var dynamicSnapshot = (DynamicEntitySnapshot)snapshot;

            _enabled    = dynamicSnapshot.Enabled;
            _position.X = dynamicSnapshot.Position.X;
            _position.Y = dynamicSnapshot.Position.Y;
            _motion.X   = dynamicSnapshot.Motion.X;
            _motion.Y   = dynamicSnapshot.Motion.Y;
        }
Ejemplo n.º 2
0
        /// <summary>Take a snapshot of the entity's state</summary>
        public virtual void UpdateSnapshot(IStatefulSnapshot snapshot)
        {
            var dynamicSnapshot = (DynamicEntitySnapshot)snapshot;

            dynamicSnapshot.Enabled    = _enabled;
            dynamicSnapshot.Position.X = _position.X;
            dynamicSnapshot.Position.Y = _position.Y;
            dynamicSnapshot.Motion.X   = _motion.X;
            dynamicSnapshot.Motion.Y   = _motion.Y;
        }
Ejemplo n.º 3
0
        public virtual void RestoreSnapshot(IStatefulSnapshot snapshot)
        {
            var binarySnapshot = (BinaryStateEntityEntitySnapshot)snapshot;

            _state = binarySnapshot.State;
        }
Ejemplo n.º 4
0
        public virtual void UpdateSnapshot(IStatefulSnapshot snapshot)
        {
            var binarySnapshot = (BinaryStateEntityEntitySnapshot)snapshot;

            binarySnapshot.State = _state;
        }
Ejemplo n.º 5
0
 public override void RestoreSnapshot(IStatefulSnapshot snapshot)
 {
     base.RestoreSnapshot(snapshot);
     var playerSnapshot = (PlayerEntitySnapshot)snapshot;
 }
Ejemplo n.º 6
0
 public override void RestoreSnapshot(IStatefulSnapshot snapshot)
 {
     base.RestoreSnapshot(snapshot);
     _desiredState = State;
 }