private void OnDisable() { GlobalList <Player> .Remove(this); ButtonHandler.Unsubscribe(this); //ButtonHandler.Instance. }
public void AddTest() { VerifyDoesntExist(); bool value = GlobalList.Add(_databasePath, _caliberTest, out _errOut); General.HasTrueValue(value, _errOut); }
public void ExistsTest() { VerifyExists(); bool value = GlobalList.Exists(_databasePath, _caliberTest, out _errOut); General.HasTrueValue(value, _errOut); }
/// <summary> /// Verifies the exists. /// </summary> private void VerifyExists() { if (!GlobalList.Exists(_databasePath, _caliberTest, out _errOut)) { bool value = GlobalList.Add(_databasePath, _caliberTest, out _errOut); } }
/// <summary> /// Verifies the doesnt exist. /// </summary> private void VerifyDoesntExist() { if (Shops.Exists(_databasePath, _shopsName, out _errOut)) { long id = Shops.GetId(_databasePath, _shopsName, out _errOut); bool value = GlobalList.Delete(_databasePath, id, out _errOut); } }
/// <summary> /// Verifies the doesnt exist. /// </summary> private void VerifyDoesntExist() { if (Inventory.Exists(_databasePath, _ammoManufacturer, _ammoName, _ammoCaliber, _ammoGrain, _ammoJacket, _ammoDCal, _ammoVelocityNumber, out _errOut)) { long id = Inventory.GetId(_databasePath, _ammoManufacturer, _ammoName, _ammoCaliber, _ammoGrain, _ammoJacket, _ammoQty, _ammoDCal, _ammoVelocityNumber, out _errOut); bool value = GlobalList.Delete(_databasePath, id, out _errOut); } }
private void OnEnable() { // The GlobalList is not restricted to TriggerEntity. // Any class can use it. GlobalList <Player> .Add(this); ButtonHandler.Subscribe(this); }
public void ListAllTest() { VerifyExists(); List <GlobalCaliberList> value = GlobalList.GetList(_databasePath, out _errOut); PrintList(value); General.HasTrueValue(value.Count > 0, _errOut); }
public void GetIdTest() { VerifyExists(); long id = GlobalList.GetId(_databasePath, _caliberTest, out _errOut); TestContext.WriteLine($"IS: {id}"); General.HasTrueValue(id > 0, _errOut); }
public void DeleteTest() { VerifyDoesntExist(); VerifyExists(); long id = GlobalList.GetId(_databasePath, _caliberTest, out _errOut); bool value = GlobalList.Delete(_databasePath, id, out _errOut); General.HasTrueValue(value, _errOut); }
public GlobalListModel(GlobalList entity, bool encodeHtml = false) { if (entity != null) { var configMapper = new MapperConfiguration(cfg => { cfg.CreateMap <GlobalList, GlobalListModel>(); }); configMapper.CreateMapper().Map(entity, this); } }
public GlobalList GetEntity() { var configMapper = new MapperConfiguration(cfg => { cfg.CreateMap <GlobalListModel, GlobalList>(); }); GlobalList entity = configMapper.CreateMapper().Map <GlobalListModel, GlobalList>(this); return(entity); }
/// <summary> /// Verifies the doesnt exist. /// </summary> private void VerifyDoesntExist() { if (GlobalList.Exists(_databasePath, _caliberTest, out _errOut)) { long id = GlobalList.GetId(_databasePath, _caliberTest, out _errOut); bool value = GlobalList.Delete(_databasePath, id, out _errOut); } if (GlobalList.Exists(_databasePath, _caliberTestUpdate, out _errOut)) { long id = GlobalList.GetId(_databasePath, _caliberTestUpdate, out _errOut); bool value = GlobalList.Delete(_databasePath, id, out _errOut); } }
public static string[] GlobalFunctions() { return((string[])GlobalList.Clone()); }
private void OnDisable() { GlobalList <PlayerController> .Remove(this); }
private void OnEnable() { GlobalList <PlayerController> .Add(this); }