Exemple #1
0
 private void setColor(BoardObject obj, Bitmap bitmap)
 {
     if (obj.isCarry())
     {
         setColor(bitmap, obj.Coords, COLOR_PLAYER1_CARRY, COLOR_PLAYER2_CARRY, (obj as Ant).Owner);
     }
     else if (obj.isScout())
     {
         setColor(bitmap, obj.Coords, COLOR_PLAYER1_SCOUT, COLOR_PLAYER2_SCOUT, (obj as Ant).Owner);
     }
     else if (obj.isWarrior())
     {
         setColor(bitmap, obj.Coords, COLOR_PLAYER1_WARRIOR, COLOR_PLAYER2_WARRIOR, (obj as Ant).Owner);
     }
     else if (obj.isBase())
     {
         Base playerbase = obj as Base;
         if (playerbase.RangeLevel > 0)
         {
             for (int i = 0; i < playerbase.RangeCoords.Count; i++)
             {
                 setColor(bitmap, playerbase.RangeCoords[i], COLOR_PLAYER1_BASE, COLOR_PLAYER2_BASE, playerbase.Player);
             }
         }
         setColor(bitmap, obj.Coords, COLOR_PLAYER1_BASE, COLOR_PLAYER2_BASE, (obj as Base).Player);
     }
     else if (obj.isSugar())
     {
         setColor(bitmap, obj.Coords, COLOR_GAME_SUGAR, Color.Transparent, null);
     }
 }