Created
October 11, 2018 12:37
-
-
Save chrisamaphone/2f681614f21a6c6bf4d152434667f58c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Metric("Gold to Enemies Ratio")] | |
public static float GoldToEnemies(object map) | |
{ | |
ChunkyLevel sl = (ChunkyLevel)map; | |
int gold = 0; | |
int enemies = 0; | |
for (int i = 0; i < sl.tiles.GetLength(0); i++) | |
{ | |
for (int j = 0; j < sl.tiles.GetLength(1); i++) | |
{ | |
if(sl.tiles[i,j] == -3) | |
{ | |
gold++; | |
} | |
if(sl.tiles[i,j] == -4) | |
{ | |
enemies++; | |
} | |
} | |
} | |
return (float)(enemies / gold); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment