示例#1
0
        public void SetPosition(ChickenUnitState unitState, DirectionalPosition position)
        {
            #region Argument Check

            if (unitState == null)
            {
                throw new ArgumentNullException("unitState");
            }

            #endregion

            _unitToPositionMap[unitState.Unit] = position;
        }
示例#2
0
        public DirectionalPosition GetPosition(ChickenUnitState unitState)
        {
            #region Argument Check

            if (unitState == null)
            {
                throw new ArgumentNullException("unitState");
            }

            #endregion

            return(_unitToPositionMap[unitState.Unit]);
        }
        public MoveInfo Get(ChickenUnitState unitState)
        {
            #region Argument Check

            if (unitState == null)
            {
                throw new ArgumentNullException("unitState");
            }

            #endregion

            return(this.InnerMap.GetValueOrDefault(unitState.Unit));
        }
示例#4
0
        public bool TryGetPosition(ChickenUnitState unitState, out DirectionalPosition position)
        {
            #region Argument Check

            if (unitState == null)
            {
                throw new ArgumentNullException("unitState");
            }

            #endregion

            return(_unitToPositionMap.TryGetValue(unitState.Unit, out position));
        }
        public void Set(ChickenUnitState unitState, MoveInfo move)
        {
            #region Argument Check

            if (unitState == null)
            {
                throw new ArgumentNullException("unitState");
            }

            #endregion

            if (move == null || unitState.IsDead)
            {
                this.InnerMap.Remove(unitState.Unit);
            }
            else
            {
                this.InnerMap[unitState.Unit] = move;
            }
        }