public void UpdateResource(UserResInfo newInfo) { this.oil = newInfo.oil; this.steel = newInfo.steel; this.ammo = newInfo.ammo; this.aluminium = newInfo.aluminium; this.gold = newInfo.gold; }
public UserResInfo GetResourceChange(UserResInfo newInfo) { UserResInfo info = new UserResInfo(); info.oil = newInfo.oil - this.oil; info.ammo = newInfo.ammo - this.ammo; info.steel = newInfo.steel - this.steel; info.aluminium = newInfo.aluminium - this.aluminium; info.gold = newInfo.gold - this.gold; return info; }
public UserResInfo GetResourceChange(UserResInfo newInfo) { return new UserResInfo { oil = newInfo.oil - this.oil, ammo = newInfo.ammo - this.ammo, steel = newInfo.steel - this.steel, aluminium = newInfo.aluminium - this.aluminium, gold = newInfo.gold - this.gold }; }