コード例 #1
0
ファイル: Extensions.cs プロジェクト: CSJedi/PathFinder
        public static Cell ToCell(this MapObjectData mapObjectData, Dictionary <UnitType, int> myArmy = null)
        {
            var x = mapObjectData.Location.X;
            var y = mapObjectData.Location.Y;
            int resourcesValue = 0;

            if (mapObjectData.Dwelling != null)
            {
                resourcesValue = mapObjectData.Dwelling.AvailableToBuyCount;
            }

            if (mapObjectData.ResourcePile != null)
            {
                resourcesValue = mapObjectData.ResourcePile.Amount;
            }

            return(new Cell(x, y, mapObjectData.GetTerrainCellType(myArmy), mapObjectData.GetObjectCellType(), resourcesValue));
        }
コード例 #2
0
ファイル: Extensions.cs プロジェクト: CSJedi/PathFinder
 public static string ToDataForPrint(this MapObjectData mapObject, Dictionary <UnitType, int> armyA = null)
 {
     return(mapObject.GetTerrainCellType(armyA).ToDataForPrint());
 }