Ejemplo n.º 1
0
        public static List <CostObject> GetBuildingCosts(int b_id)
        {
            using (var db = new MinionWarsEntities())
            {
                db.Configuration.LazyLoadingEnabled = false;
                List <CostsBuilding> cbl = db.CostsBuilding.Where(x => x.b_id == b_id).ToList();
                List <CostObject>    col = new List <CostObject>();
                foreach (CostsBuilding cb in cbl)
                {
                    CostObject co = new CostObject(cb);
                    col.Add(co);
                }

                return(col);
            }
        }
Ejemplo n.º 2
0
        public static List <CostObject> GetCampCosts()
        {
            List <CostObject> col = new List <CostObject>();

            using (var db = new MinionWarsEntities())
            {
                List <ResourceType> rtl = db.ResourceType.ToList();
                foreach (ResourceType rt in rtl)
                {
                    CostsBuilding cb = new CostsBuilding();
                    cb.r_id   = rt.id;
                    cb.amount = 50;

                    CostObject co = new CostObject(cb);
                    col.Add(co);
                }
            }

            return(col);
        }