コード例 #1
0
        private static INPC EnsureCorrectXAndY(INPC npc, byte destinationX, byte destinationY)
        {
            var opposite = npc.Direction.Opposite();
            var tempNPC  = npc
                           .WithDirection(opposite)
                           .WithX(destinationX)
                           .WithY(destinationY);

            return(npc
                   .WithX((byte)tempNPC.GetDestinationX())
                   .WithY((byte)tempNPC.GetDestinationY()));
        }