private void ZeroPopulation(Faction faction) { Population[faction] = 0; UpdatePopulationEventArgs args = new UpdatePopulationEventArgs(); args.faction = faction; args.amount = Population[faction]; OnUpdatePopulation(args); }
private void SubstractPopulation(Faction faction, int amount) { Population[faction] -= amount; UpdatePopulationEventArgs args = new UpdatePopulationEventArgs(); args.faction = faction; args.amount = Population[faction]; OnUpdatePopulation(args); }
private static void OnUpdatePopulation(Object sender, UpdatePopulationEventArgs e) { //Population update triggered by the game Server.SendPopulationUpdateToAll(e.faction, e.amount); }
protected virtual void OnUpdatePopulation(UpdatePopulationEventArgs e) { UpdatePopulation?.Invoke(this, e); }