コード例 #1
0
ファイル: Creature.cs プロジェクト: manderin87/DungeonMaster
 private async Task <bool> MoveToNeighbourTile(Tile tile, bool findEnemies)
 {
     if (tile.IsAccessible) //TODO other conditions
     {
         if (await MoveThroughSpaces(tile, findEnemies))
         {
             if (!hounting && !gettingHome)
             {
                 watchAroundArea.SetBundle(tile, watchAroundArea.GetBundle(tile) + 1);
             }
             return(true);
         }
         else
         {
             return(false);
         }
     }
     return(false);
 }
コード例 #2
0
 protected virtual async Task <bool> MoveToNeighbourTile(ITile tile, bool findEnemies)
 {
     if (tile.IsAccessible && !tile.IsDangerous)
     {
         //move was successful and no teleporation occurred afterwards
         if (await MoveThroughSpaces(tile, findEnemies) && Location == tile)
         {
             if (!hounting && !gettingHome)
             {
                 watchAroundArea.SetBundle(tile, watchAroundArea.GetBundle(tile) + 1);
             }
             return(true);
         }
         else
         {
             return(false);
         }
     }
     return(false);
 }