コード例 #1
0
        /// <summary>
        /// Constructs movement data.
        /// </summary>
        /// <param name="walk">Must be a valid movement. CANNOT be a noop.</param>
        /// <param name="run">Optional, if set, movement is will be interpreted as running.</param>
        public MoveMessage(DirectionDelta walk, DirectionDelta run)
        {
            Debug.Assert(!walk.IsNoop());

            Dir1 = walk;
            Dir2 = run;

            IsWalking = Dir2.IsNoop();
        }
コード例 #2
0
 public GeneratedDirections(DirectionDelta walk, DirectionDelta run)
 {
     // if walk is noop but run isin't, swap places
     if (walk.IsNoop() && !run.IsNoop())
     {
         Walk = run;
         Run  = walk;
     }
     else
     {
         Walk = walk;
         Run  = run;
     }
 }