// Checks if bonus is taken by someone: object OnCheck_IsBonusTaken(CBonus bonus) { int mapX = (int)(bonus.X / cellSize); int mapY = (int)(bonus.Y / cellSize); CTank bonustank = null; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { bonustank = (mapMain[mapX + i, mapY + j] as CTankPlayer); if (bonustank != null) { return(bonustank); } } } return(null); }
public BonusEventArgs(CBonus b) { bonus = b; }