HelloWorld.Unit.Move C# (CSharp) Method

Move() public method

移动单位
public Move ( Direction direction ) : bool
direction Direction 移动方向
return bool
        public virtual bool Move( Direction direction )
        {
            var now = DateTime.UtcNow;
              Check( now );

              var target = GameHost.DataService.GetPlace( Coordinate.GetCoordinate( direction ) );

              lock ( SyncRoot )
              {

            var m = MobilityRequired( target );

            if ( Mobility < m || m == -1 )
              return false;

            Coordinate = target.Coordinate;
            Mobility -= m;
            LastActTime = now;

            Save();
            return true;
              }
        }