Beispiel #1
0
 public void checkForFinishedBuilding(unitLib uLib)
 {
     if (productionProgress >= buildingInProgress.prodCost)
     {
         if (buildingInProgress.name == "Scout")
         {
             uLib.CreateNewUnit(infoLibrary.Scout("max", 0), tileLibrary.FindIndex_AtTile(tileLibrary.FindTile_AtCityID(cityID)), tileLibrary);
             buildingInProgress = null;
         }
         else if (buildingInProgress.name == "Warrior")
         {
             uLib.CreateNewUnit(infoLibrary.Warrior("max", 0), tileLibrary.FindIndex_AtTile(tileLibrary.FindTile_AtCityID(cityID)), tileLibrary);
             buildingInProgress = null;
         }
         else
         {
             buildingList.Add(buildingInProgress);
             buildingInProgress = null;
         }
     }
 }
Beispiel #2
0
 public void newTurn(unitLib ulib)
 {
     foodStash += cityYield[0];
     productionProgress += cityYield[1];
     if (foodStash > 10)
     {
         peopleCap += 1;
         unassignedPeople += 1;
     }
     checkForFinishedBuilding(ulib);
     UpdateWholeCity();
 }
Beispiel #3
0
        /// <summary>
        /// </summary>
        /// <param name="tileIndex"></param>
        /// <param name="unitID"></param>
        /// <param name="postiveORnegative"></param>
        /// <param name="XYZ"></param>
        public void MoveUnit(int unitID, tile tileAt, tile tileTo, unitLib uLib)
        {
            if (tileAt.unitExists(unitID) && Tile_IsAdjacentTo(tileAt, tileTo) && uLib.unitList[uLib.FindIndexOfUnit_AtUnitID(unitID)].CurrentMovePoints > 0)
            {
                tileAt.removeUnit(unitID);
                tileTo.addUnit(unitID);

                uLib.unitList[uLib.FindIndexOfUnit_AtUnitID(unitID)].CurrentMovePoints--;
            }
        }