public void Sell(DateTime time, ulong id) { if (Weapons.ContainsKey(id)) { var last = Weapons.GetLast(id); if (last.Sold == false) // if not sold { Weapons[id] = new SuitWeapon(time, id, last.FDName, last.Name_Localised, last.Price, last.Class, last.WeaponMods, true); // new entry with this time but sold } else { System.Diagnostics.Debug.WriteLine("Weapons sold a weapon already sold " + id); } } else { System.Diagnostics.Debug.WriteLine("Weapons sold a weapon not seen " + id); } }
public void Upgrade(DateTime time, ulong id, int cls, string[] weaponmods) { if (Weapons.ContainsKey(id)) { var last = Weapons.GetLast(id); if (last.Sold == false) // if not sold { // new entry with the new class Weapons[id] = new SuitWeapon(time, id, last.FDName, last.Name_Localised, last.Price, cls, weaponmods, false); } else { System.Diagnostics.Debug.WriteLine("Weapons upgrade but already sold " + id); } } else { System.Diagnostics.Debug.WriteLine("Weapons upgrade a weapon not seen " + id); } }
public void Remove(ulong id, string slotname, SuitWeapon weap) { if (loadouts.ContainsKey(id)) { var last = loadouts.GetLast(id); if (last.Modules.ContainsKey(slotname)) { var ld = new SuitLoadout(last); ld.Modules.Remove(slotname); loadouts.Add(id, ld); System.Diagnostics.Debug.WriteLine("Suits Remove {0}-{1}-{2} with {3}", last.ID, last.Name, slotname, weap.Name_Localised); } else { System.Diagnostics.Debug.WriteLine("Suits Remove Failed {0}-{1}-{2} with {3}", last.ID, last.Name, slotname, weap.Name_Localised); } } else { System.Diagnostics.Debug.WriteLine("Suits remove an unknown loadout " + id); } }
public bool VerifyPresence(DateTime time, ulong id, string fdname, string namelocalised, long price, int cls, string[] weaponmods) { var w = Weapons.GetLast(id); if (w == null) { System.Diagnostics.Debug.WriteLine("Missing weapon {0} {1} {2}", id, fdname, namelocalised); Weapons[id] = new SuitWeapon(time, id, fdname, namelocalised, price, cls, weaponmods, false); return(false); } else { // if differs in cls, or weapons mods is null but new one isnt, or both are set but different if (w.Class != cls || (w.WeaponMods == null && weaponmods != null) || (w.WeaponMods != null && weaponmods != null && !w.WeaponMods.SequenceEqual(weaponmods))) { //System.Diagnostics.Debug.WriteLine("Update weapon info {0} {1} {2}", id, fdname, namelocalised); Weapons[id] = new SuitWeapon(time, id, fdname, namelocalised, w.Price, cls, weaponmods, false); return(false); } } return(true); }
public void Buy(DateTime time, ulong id, string fdname, string namelocalised, long price, int cls, string[] weaponmods) { Weapons[id] = new SuitWeapon(time, id, fdname, namelocalised, price, cls, weaponmods, false); }