Esempio n. 1
0
        public TargetReservationModel GetTarget(int mapPosition)
        {
            MemberContext db         = new MemberContext();
            var           targetList = db.Reservations.ToList();

            foreach (var target in targetList)
            {
                if (target != null && target.Target == mapPosition)
                {
                    return(target);
                }
            }
            return(new TargetReservationModel());
        }
Esempio n. 2
0
        public List <MemberModel> GetAllMembers()
        {
            MemberContext db = new MemberContext();

            return(db.Members.ToList());
        }
Esempio n. 3
0
        public void ClearTargets()
        {
            MemberContext db = new MemberContext();

            db.Database.ExecuteSqlCommand("TRUNCATE TABLE Reservations");
        }
Esempio n. 4
0
        public WarPlanModel GetWarPlan()
        {
            MemberContext db = new MemberContext();

            return(db.WarPlans.OrderByDescending(x => x.Id).FirstOrDefault() ?? WarPlanModel.Empty());
        }