Пример #1
0
        public List <WardType> GetAll()
        {
            WardTypeDAC     _wardTypeComponent = new WardTypeDAC();
            IDataReader     reader             = _wardTypeComponent.GetAllWardType().CreateDataReader();
            List <WardType> _wardTypeList      = new List <WardType>();

            while (reader.Read())
            {
                if (_wardTypeList == null)
                {
                    _wardTypeList = new List <WardType>();
                }
                WardType _wardType = new WardType();
                if (reader["WardTypeId"] != DBNull.Value)
                {
                    _wardType.WardTypeId = Convert.ToInt32(reader["WardTypeId"]);
                }
                if (reader["WardTypeName"] != DBNull.Value)
                {
                    _wardType.WardTypeName = Convert.ToString(reader["WardTypeName"]);
                }
                _wardType.NewRecord = false;
                _wardTypeList.Add(_wardType);
            }
            reader.Close();
            return(_wardTypeList);
        }
Пример #2
0
        public static string ToCustomString(this WardType wardType)
        {
            switch (wardType)
            {
            case WardType.SightWard:
                return("SIGHT_WARD");

            case WardType.TeemoMushroom:
                return("TEEMO_MUSHROOM");

            case WardType.Undefined:
                return("UNDEFINED");

            case WardType.VisionWard:
                return("VISION_WARD");

            case WardType.YellowTrinket:
                return("YELLOW_TRINKET");

            case WardType.YellowTrinketUpgrade:
                return("YELLOW_TRINKET_UPGRADE");

            case WardType.BlueTrinket:
                return("BLUE_TRINKET");

            default:
                return(string.Empty);
            }
        }
Пример #3
0
 public DetectedWards(Obj_AI_Minion ward, Vector3 position, WardType type, int starttime, int endtime)
 {
     this.Ward      = ward;
     this.Position  = position;
     this.StartTime = starttime;
     this.EndTime   = endtime;
     this.Type      = type;
 }
Пример #4
0
 public WardStruct(int duration, int range, string objectBaseSkinName, string spellName, WardType type)
 {
     Duration           = duration;
     Range              = range;
     ObjectBaseSkinName = objectBaseSkinName;
     SpellName          = spellName;
     Type = type;
 }
Пример #5
0
        public ActionResult DeleteConfirmed(int id)
        {
            WardType wardType = db.WardTypes.Find(id);

            db.WardTypes.Remove(wardType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #6
0
 public WardStruct(int duration, int range, string objectBaseSkinName, string spellName, WardType type)
 {
     this.Duration           = duration;
     this.Range              = range;
     this.ObjectBaseSkinName = objectBaseSkinName;
     this.SpellName          = spellName;
     this.Type = type;
 }
Пример #7
0
 public WardItem(int id, string name, string spellName, int range, int duration, WardType type)
 {
     Id        = id;
     Name      = name;
     SpellName = spellName;
     Range     = range;
     Duration  = duration;
     Type      = type;
 }
Пример #8
0
 public ActionResult Edit([Bind(Include = "WardTypeId,Name,description")] WardType wardType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(wardType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(wardType));
 }
Пример #9
0
        public ActionResult Create([Bind(Include = "WardTypeId,Name,description")] WardType wardType)
        {
            if (ModelState.IsValid)
            {
                db.WardTypes.Add(wardType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(wardType));
        }
Пример #10
0
        public bool Insert(WardType wardtype)
        {
            int         autonumber        = 0;
            WardTypeDAC wardtypeComponent = new WardTypeDAC();
            bool        endedSuccessfuly  = wardtypeComponent.InsertNewWardType(ref autonumber, wardtype.WardTypeName);

            if (endedSuccessfuly)
            {
                wardtype.WardTypeId = autonumber;
            }
            return(endedSuccessfuly);
        }
Пример #11
0
        public static bool GetWarInfo(string skinName, out int duration, out WardType type)
        {
            switch (skinName)
            {
            case "YellowTrinket":
                duration = 60 * 1000;
                type     = WardType.Green;
                break;

            case "YellowTrinketUpgrade":
                duration = 60 * 2 * 1000;
                type     = WardType.Green;
                break;

            case "SightWard":
                duration = 60 * 3 * 1000;
                type     = WardType.Green;
                break;

            case "VisionWard":
                duration = int.MaxValue;
                type     = WardType.Pink;
                break;

            case "CaitlynTrap":
                duration = 60 * 4 * 1000;
                type     = WardType.Trap;
                break;

            case "TeemoMushroom":
                duration = 60 * 10 * 1000;
                type     = WardType.Trap;
                break;

            case "Nidalee_Spear":
                duration = 60 * 2 * 1000;
                type     = WardType.Trap;
                break;

            case "ShacoBox":
                duration = 60 * 1 * 1000;
                type     = WardType.Trap;
                break;

            default:
                duration = 0;
                type     = WardType.None;
                return(false);
            }
            return(true);
        }
Пример #12
0
        // GET: WardTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WardType wardType = db.WardTypes.Find(id);

            if (wardType == null)
            {
                return(HttpNotFound());
            }
            return(View(wardType));
        }
Пример #13
0
 private void OnCreateObject(GameObject sender, EventArgs args)
 {
     if (!_menuhandler.GetValue <bool>((Menu)_Mainmenu.Item("Global Switches"), "ward_tracker"))
     {
         return;
     }
     if (sender != null && sender.IsValid() &&
         (sender.Name.Contains("Ward") || sender.Name.Contains("JammerDevice") ||
          sender.Name.Contains("DoABarrelRoll") && _menuhandler.GetValue <bool>(_menu, "maokai") ||
          sender.Name.Contains("Noxious") && _menuhandler.GetValue <bool>(_menu, "teemo") ||
          sender.Name.Contains("Seed") && _menuhandler.GetValue <bool>(_menu, "zyra") ||
          sender.Name.Contains("Cupcake") && _menuhandler.GetValue <bool>(_menu, "caitlyn")))
     {
         if (sender.Name != "WardCorpse")
         {
             var x = new WardType(sender, Game.Time);
             if (sender.Name.Contains("DoABarrelRoll")) //Maokai
             {
                 x.override_time = 30;
             }
             if (sender.Name.Contains("Seed")) //Maokai
             {
                 x.override_time = 60;
             }
             if (sender.Name.Contains("Cupcake")) //Caitlyn
             {
                 x.override_time = 90;
             }
             wards.Add(x);
         }
     }
     else
     {
         foreach (var ward in wards)
         {
             if (!ward.ward.IsValid() || ward.ward.Health == 0 || ward.ward.Position == sender.Position)
             {
                 wards.Remove(ward);
                 break;
             }
         }
     }
 }
Пример #14
0
        public WardsConfig GetDefinitionFor(WardType type)
        {
            if (!_typeConfigMap.TryGetValue(type, out WardsConfig config))
            {
                foreach (var cfg in WardConfig)
                {
                    if (type != cfg.WardType)
                    {
                        continue;
                    }

                    config = cfg;
                    _typeConfigMap.Add(type, config);
                    return(config);
                }
                throw new Exception($"{name} does not contain a definition for type {type}");
            }

            return(config);
        }
Пример #15
0
        public WardType GetByID(int _wardTypeId)
        {
            WardTypeDAC _wardTypeComponent = new WardTypeDAC();
            IDataReader reader             = _wardTypeComponent.GetByIDWardType(_wardTypeId);
            WardType    _wardType          = null;

            while (reader.Read())
            {
                _wardType = new WardType();
                if (reader["WardTypeId"] != DBNull.Value)
                {
                    _wardType.WardTypeId = Convert.ToInt32(reader["WardTypeId"]);
                }
                if (reader["WardTypeName"] != DBNull.Value)
                {
                    _wardType.WardTypeName = Convert.ToString(reader["WardTypeName"]);
                }
                _wardType.NewRecord = false;
            }
            reader.Close();
            return(_wardType);
        }
Пример #16
0
 public WardData(WardType type, Polygon shape)
 {
     Type  = type;
     Shape = shape;
 }
Пример #17
0
 public WardItem(int id, string name, string spellName, int range, int duration, WardType type)
 {
     Id = id;
     Name = name;
     SpellName = spellName;
     Range = range;
     Duration = duration;
     Type = type;
 }
Пример #18
0
        public bool Update(WardType wardtype, int old_wardTypeId)
        {
            WardTypeDAC wardtypeComponent = new WardTypeDAC();

            return(wardtypeComponent.UpdateWardType(wardtype.WardTypeName, old_wardTypeId));
        }
Пример #19
0
 internal Ward(int id, int baseAddr, WardType type)
     : base(id, baseAddr)
 {
     this.type = type;
 }
Пример #20
0
 public bool DeleteWardType(WardType WardType)
 {
     _log.LogError("");
     return(_repository.Delete <WardType>(WardType));
 }
Пример #21
0
 public bool EditWardType(WardType WardType)
 {
     _log.LogError("");
     return(_repository.Update <WardType>(WardType));
 }
Пример #22
0
 public bool RecoredWardType(WardType WardType)
 {
     _log.LogError("");
     return(_repository.Create <WardType>(WardType));
 }
Пример #23
0
 public WardType FindWardType(WardType WardType)
 {
     _log.LogError("");
     return(_repository.Find <WardType>(w => w.WardTypeId == WardType.WardTypeId));
 }