Exemple #1
0
        public static ResourceSystem CheckAndSaveResourceSystem(ResourceSystem rs, ResourceSystemType newType, int chrId)
        {
            if (rs != null && rs.Type != newType)
            {
                rs.SaveToDatabase(chrId); //This actually doesn't always do something
            }
            if (rs == null || rs.Type != newType)
            {
                switch (newType)
                {
                case ResourceSystemType.Hunter:
                    return(new QuiverCartridgeSystem());

                case ResourceSystemType.Bandit:
                    return(new BodyCountSystem());

                case ResourceSystemType.Aran:
                    return(new AranSystem());

                case ResourceSystemType.Phantom:
                    PhantomSystem phantomResource = new PhantomSystem();
                    using (LeattyContext DBContext = new LeattyContext())
                    {
                        phantomResource.PopulateSkills(DBContext.StolenSkills.Where(x => x.CharacterId == chrId).ToList());
                    }
                    return(phantomResource);

                case ResourceSystemType.Luminous:
                    return(new LuminousSystem());

                default:
                    return(null);
                }
            }
            return(rs);
        }
Exemple #2
0
 public ResourceSystem(ResourceSystemType type)
 {
     Type = type;
 }