コード例 #1
0
        public void ProcessContent(IContentPersister persister)
        {
            using (var db = new GameDatabaseContext())
            {
                var repo = new QuestRepository(db);
                var items = repo.GetAll();

                foreach (var item in items)
                {

                    // Save out properties we want to a new object and then persist
                    dynamic persistable = new ExpandoObject();

                    Console.WriteLine("Processing quest with ID {0}", item.Id);

                    persistable.id = item.Id;
                    persistable.name = item.Name;
                    persistable.description = item.Description;

                    persister.Persist(persistable, "\\quests\\{0}.json".FormatWith(item.Id));

                }

            }
        }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        this.currentTime = 0f;
        this.score       = 0;
        this.updateScore(this.score);
        this.updateTimer();

        this.inGameSceneParameter = SceneMoveManager.Instance.CurrentSceneParameter as InGameSceneParameter;
        if (this.inGameSceneParameter == null)
        {
            var characterRepository  = new CharacterRepository();
            var questGroupRepository = new QuestGroupRepository();
            var questRepository      = new QuestRepository();
            this.inGameSceneParameter = new InGameSceneParameter(
                characterRepository.Get(0),
                questGroupRepository.Get(0),
                questRepository.Get(1001001)
                );
        }

        Instantiate(Resources.Load("InGame/Stage" + this.inGameSceneParameter.QuestGroup.ID));
        GameObject player = (GameObject)Instantiate(Resources.Load("InGame/" + this.inGameSceneParameter.Character.iconPath));

        player.GetComponent <PlayerController>().Init(this.inGameSceneParameter.Character.Type);

        SoundManager.Instance.PlayBgm("vigilante");
    }
コード例 #3
0
        private void SetOpenInfo()
        {
            var playerQuestRepository = new PlayerQuestRepository();

            var questRep = new QuestRepository();

            foreach (var model in questRep.GetALL())
            {
                if (model.openClearQuestID != quest.ID)
                {
                    continue;
                }
                if (playerQuestRepository.Get(model.ID).IsClear())
                {
                    continue;
                }

                this.opneInfo.text += "新クエストが開放されました。\n";

                if (!quest.ID.ToString().EndsWith("3"))
                {
                    continue;
                }

                if (quest.ID.ToString().EndsWith("3003"))
                {
                    continue;
                }

                this.opneInfo.text += "新しいキャラクタが開放されました。\n";
            }
        }
コード例 #4
0
        public void ImportFromQuestListXML()
        {
            ISessionFactory fac     = RomViewContainer.Container.GetInstance <ISessionFactory>();
            ISession        session = fac.OpenSession();
            ITransaction    tx      = session.BeginTransaction();

            CallSessionContext.Bind(session);
            //LazySessionContext.Bind(new Lazy<ISession>(() => session), fac);
            try
            {
                IRepository <QuestDefinition> rep  = RomViewContainer.Container.GetInstance <IRepository <QuestDefinition> >();
                IQuestRepository        repository = new QuestRepository(rep);
                IList <QuestDefinition> items      = repository.GetAll();

                string filename = "Data\\questlist.xml";
                if (!File.Exists(filename))
                {
                    throw new Exception("File missing");
                }

                list data = new list();
                data = list.LoadFromFile(filename);

                XmlDocument doc = new XmlDocument();
                doc.Load(filename);

                XmlNodeList quests = doc.SelectNodes("//romquest");

                foreach (XmlNode romquest in quests)
                {
                    int    id   = Convert.ToInt32(romquest.Attributes["id"].Value);
                    string name = romquest.Attributes["name"].Value;

                    QuestDefinition quest = items.FirstOrDefault(definition => definition.RomId == id);
                    if (quest == null)
                    {
                        quest = new QuestDefinition()
                        {
                            RomId = id, Name = name
                        };
                        repository.Add(quest);
                    }
                    else
                    {
                        quest.RomId = id;
                        quest.Name  = name;
                        repository.Update(quest);
                    }
                }

                tx.Commit();
            }
            finally
            {
                session.Close();
            }
        }
コード例 #5
0
        protected override void Save()
        {
            var ContentTemplate = this.ContentTemplate as QuestTemplate;

            // Persist rewards
            ContentTemplate.Rewards = questRewardEditor1.Rewards;
            ContentTemplate.QuestSteps = questStepEditor1.Steps;

            using (var db = new GameDatabaseContext())
            {

                var repository = new QuestRepository(db);
                repository.Update(ContentTemplate, ContentTemplate.Id);
            }

            base.Save();
        }
コード例 #6
0
 public Rmh_Repositories()
 {
     Achievements   = new AchievementRepository();
     CraftableItems = new CraftableItemRepository();
     CraftLists     = new CraftListRepository();
     Items          = new ItemRepository();
     Dismantle      = new DismantleRepository();
     QuestItems     = new QuestItemRepository();
     Interactable   = new InteractableRepository();
     Enemies        = new EnemyRepository();
     Vendor         = new NPCVendorRepository();
     Quests         = new QuestRepository();
     Skills         = new SkillRepository();
     StatusEffects  = new StatusEffectRepository();
     Talents        = new TalentRepository();
     WorldMap       = new WorldMapRepository();
     LootTables     = new LootTableRepository();
 }
コード例 #7
0
        public void Handle(QuestClicked message)
        {
            var quest = QuestRepository.GetQuestByID(message.QuestID);

            if (quest == null)
            {
                return;
            }

            var navItem = NavigationItems.FirstOrDefault(x => x.ViewModelType == typeof(QuestDetailsViewModel));

            if (navItem == null)
            {
                return;
            }
            if (navItem.IsVisible == false)
            {
                navItem.IsVisible = true;
            }

            navItem.Content    = quest.Name;
            navItem.IsSelected = true;
        }
コード例 #8
0
        public RpgController()
        {
            EventRepository = new EventRepository(_context);
            EventLinkItemRepository = new EventLinkItemRepository(_context);
            QuestRepository = new QuestRepository(_context);
            HeroRepository = new HeroRepository(_context);
            SkillRepository = new SkillRepository(_context);
            GuildRepository = new GuildRepository(_context);
            SkillSchoolRepository = new SkillSchoolRepository(_context);
            TrainingRoomRepository = new TrainingRoomRepository(_context);
            CharacteristicRepository = new CharacteristicRepository(_context);
            CharacteristicTypeRepository = new CharacteristicTypeRepository(_context);
            StateRepository = new StateRepository(_context);
            StateTypeRepository = new StateTypeRepository(_context);

            //using (var scope = StaticContainer.Container.BeginLifetimeScope())
            //{
            //    EventRepository = scope.Resolve<IEventRepository>();
            //    QuestRepository = scope.Resolve<IQuestRepository>();
            //    HeroRepository = scope.Resolve<IHeroRepository>();
            //    SkillRepository = scope.Resolve<ISkillRepository>();
            //}
        }
コード例 #9
0
 public FlagsController(QuestRepository questRepository)
 {
     this._questRepository = questRepository;
 }
コード例 #10
0
        public void TestCanAddSingleItem()
        {
            ISessionFactory fac     = RomViewContainer.Container.GetInstance <ISessionFactory>();
            ISession        session = fac.OpenSession();
            ITransaction    tx      = session.BeginTransaction();

            CallSessionContext.Bind(session);

            try
            {
                IRepository <QuestDefinition> rep =
                    RomViewContainer.Container.GetInstance <IRepository <QuestDefinition> >();
                IQuestRepository repository = new QuestRepository(rep);

                QuestChain chain = new QuestChain()
                {
                    Name = "Saving a Marriage"
                };

                IRepository <QuestChain> chainRep = RomViewContainer.Container.GetInstance <IRepository <QuestChain> >();
                try
                {
                    chain = chainRep.SaveOrUpdate(chain);
                }
                catch
                {
                }

                QuestDefinition def = new QuestDefinition()
                {
                    RomId             = 423924,
                    Name              = "Act First and Report Later",
                    MinLevel          = 25,
                    Level             = 27,
                    StarterId         = 117396,
                    EnderId           = 117396,
                    Gold              = 1515,
                    XP                = 17301,
                    TP                = 1730,
                    RewardCategory    = RewardCategory.Armor,
                    RewardSubCategory = RewardSubCategory.Head,
                    ChainIndex        = 4,
                    QuestChain        = chain
                };

                IRepository <ItemDefinition> idef = RomViewContainer.Container.GetInstance <IRepository <ItemDefinition> >();

                ItemRepository irep = new ItemRepository(idef);
                ItemDefinition item = irep.GetByRomId(228250);
                item.ItemType       = "armor";
                item.ItemSubType    = "cloth";
                item.ItemSubSubType = "head";
                item.Value          = 196;
                irep.UpdateItem(item);

                QuestReward reward = new QuestReward()
                {
                    Item        = item,
                    RewardIndex = 1,
                    RewardType  = "Cloth",
                    Quest       = def
                };
                def.Rewards.Add(reward);

                item                = irep.GetByRomId(228251);
                item.ItemType       = "armor";
                item.ItemSubType    = "leather";
                item.ItemSubSubType = "head";
                item.Value          = 261;
                irep.UpdateItem(item);

                reward = new QuestReward()
                {
                    Item = item, RewardIndex = 2, RewardType = "Leather", Quest = def
                };
                def.Rewards.Add(reward);

                repository.Add(def);
            }
            finally
            {
                tx.Rollback();
                session.Close();
            }
        }