Esempio n. 1
0
        private void OnDisable()
        {
            GlobalList <Player> .Remove(this);

            ButtonHandler.Unsubscribe(this);
            //ButtonHandler.Instance.
        }
Esempio n. 2
0
        public void AddTest()
        {
            VerifyDoesntExist();
            bool value = GlobalList.Add(_databasePath, _caliberTest, out _errOut);

            General.HasTrueValue(value, _errOut);
        }
Esempio n. 3
0
        public void ExistsTest()
        {
            VerifyExists();
            bool value = GlobalList.Exists(_databasePath, _caliberTest, out _errOut);

            General.HasTrueValue(value, _errOut);
        }
Esempio n. 4
0
 /// <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);
     }
 }
Esempio n. 6
0
 /// <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);
     }
 }
Esempio n. 7
0
        private void OnEnable()
        {
            // The GlobalList is not restricted to TriggerEntity.
            // Any class can use it.
            GlobalList <Player> .Add(this);

            ButtonHandler.Subscribe(this);
        }
Esempio n. 8
0
        public void ListAllTest()
        {
            VerifyExists();
            List <GlobalCaliberList> value = GlobalList.GetList(_databasePath, out _errOut);

            PrintList(value);
            General.HasTrueValue(value.Count > 0, _errOut);
        }
Esempio n. 9
0
        public void GetIdTest()
        {
            VerifyExists();
            long id = GlobalList.GetId(_databasePath, _caliberTest, out _errOut);

            TestContext.WriteLine($"IS: {id}");
            General.HasTrueValue(id > 0, _errOut);
        }
Esempio n. 10
0
        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);
        }
Esempio n. 11
0
 public GlobalListModel(GlobalList entity, bool encodeHtml = false)
 {
     if (entity != null)
     {
         var configMapper = new MapperConfiguration(cfg =>
         {
             cfg.CreateMap <GlobalList, GlobalListModel>();
         });
         configMapper.CreateMapper().Map(entity, this);
     }
 }
Esempio n. 12
0
        public GlobalList GetEntity()
        {
            var configMapper = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <GlobalListModel, GlobalList>();
            });

            GlobalList entity = configMapper.CreateMapper().Map <GlobalListModel, GlobalList>(this);

            return(entity);
        }
Esempio n. 13
0
        /// <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);
            }
        }
Esempio n. 14
0
 public static string[] GlobalFunctions()
 {
     return((string[])GlobalList.Clone());
 }
 private void OnDisable()
 {
     GlobalList <PlayerController> .Remove(this);
 }
 private void OnEnable()
 {
     GlobalList <PlayerController> .Add(this);
 }