public void paymentPhase(Village v) { int totalWages = v.getTotalWages (); int villageGold = v.getGold (); if (villageGold >= totalWages) { //means have enough money to pay units villageGold = villageGold - totalWages; v.gameObject.networkView.RPC ("setGoldNet",RPCMode.AllBuffered,villageGold); } else { v.retireAllUnits(); } }