Exemplo n.º 1
0
 /// <summary>
 /// Добавить новый блок растения по условию роста
 /// </summary>
 /// <param name="X"></param>
 /// <param name="Y"></param>
 /// <param name="OneBlockPlant"></param>
 private void AddNewBlockPlant(int X, int Y, BlockPlant OneBlockPlant)
 {
     if (OneBlockPlant.CanEnergyToGrowth)
     {
         TypeBlocks GetBlock = MainWorld.GetTypeBlockMap(X, Y);
         if (GetBlock != TypeBlocks.Blocked && (GetBlock == TypeBlocks.Void || GetBlock == TypeBlocks.Air))
         {
             OneBlockPlant.SpendEnergyToGrowth();
             StackBlocksPlant.Add(new BlockPlant(X, Y));
             MainWorld.SetPointWorldMap(X, Y, TypeBlocks.Plant);
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Удалить блок растения с карты
 /// </summary>
 /// <param name="blockPlant"></param>
 public static void DieBlockInWorldMap(BlockPlant blockPlant)
 {
     MainWorld.SetPointWorldMap(blockPlant.X, blockPlant.Y, TypeBlocks.Void);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Предикат определения смерти блока
 /// </summary>
 /// <param name="blockPlant"></param>
 /// <returns></returns>
 public static bool DeathByEnergyStarvation(BlockPlant blockPlant)
 {
     return(blockPlant.Energy <= 0);
 }