コード例 #1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ChickenUnitState"/> class.
        /// </summary>
        internal ChickenUnitState(ChickenUnit unit, MoveInfo previousMove, MoveInfoStates previousMoveState)
        {
            #region Argument Check

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

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

            #endregion

            this.Unit              = unit;
            this.UniqueId          = unit.UniqueId;
            this.Team              = unit.Team;
            this.IsDead            = unit.IsDead;
            this.Position          = unit.Position;
            this.BeakAngle         = unit.BeakAngle;
            this.PreviousMove      = previousMove;
            this.PreviousMoveState = previousMoveState;
            this.View              = new ViewInfo(unit);
            this.CanShoot          = unit.CanShoot();
        }
コード例 #2
0
 public static bool IsRejected(this MoveInfoStates value)
 {
     return((value & MoveInfoStates.RejectedMask) != 0);
 }