Exemple #1
0
        private PlayerSnapshotState EnsureState(Expansion ex)
        {
            if (Owner == null || Owner.Deleted)
            {
                return(null);
            }

            PlayerSnapshotState state;

            if (!States.TryGetValue(ex, out state))
            {
                States.Add(ex, state = new PlayerSnapshotState(Owner, ex));
            }
            else if (state == null)
            {
                States[ex] = state = new PlayerSnapshotState(Owner, ex);
            }

            return(state);
        }
        private PlayerSnapshotState EnsureState(Expansion ex)
        {
            if (Owner == null || Owner.Deleted)
            {
                return null;
            }

            PlayerSnapshotState state;

            if (!States.TryGetValue(ex, out state))
            {
                States.Add(ex, state = new PlayerSnapshotState(Owner, ex));
            }
            else if (state == null)
            {
                States[ex] = state = new PlayerSnapshotState(Owner, ex);
            }

            return state;
        }
Exemple #3
0
        /// <summary>
        ///     Push values to the player, based on the given expansion.
        /// </summary>
        public bool Push(Expansion ex)
        {
            PlayerSnapshotState state = EnsureState(ex);

            return(state != null && state.Push());
        }