コード例 #1
0
 public void SetUp()
 {
     _stageMock = new Mock <IStage>();
     _stageName = Helper.GetUniqueName();
     _stageMock.SetupGet(p => p.Name).Returns(_stageName);
     _dataAdapterMock  = new Mock <IFileSystemDataAdapter <IStage> >();
     _stageDataManager = new StageDataManager(_dataAdapterMock.Object);
 }
コード例 #2
0
ファイル: StageDataManager.cs プロジェクト: CBorange/MimePark
 public static StageDataManager GetInstance()
 {
     if (!instance)
     {
         container = new GameObject("StageDataManager");
         instance  = container.AddComponent <StageDataManager>();
     }
     return(instance);
 }
コード例 #3
0
    public StageDataManager()
    {
        instance = this;

        EventSystem.Instance.addEventListener(StageSyncServerEvent.STAGE_SYNC_SERVER_EVENT, onSyncStageData);
        EventSystem.Instance.addEventListener(StageEnterEvent.STAGE_ENTER_RESPOND_EVENT, stageEnterSuccessed);
        EventSystem.Instance.addEventListener(PropertyEvent.MAIN_PROPERTY_CHANGE, onMainPropertyChange);
        EventSystem.Instance.addEventListener(QuestEvent.QUEST_ACCEPT, OnAcceptQuestResponse);
    }
コード例 #4
0
ファイル: Key.cs プロジェクト: CBorange/MimePark
 private void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "PLAYER")
     {
         playerTrans = col.gameObject.transform;
         gameObject.SetActive(false);
         StageDataManager.GetInstance().HaveKey += 1;
         ItemSlotManager.GetInstance().AttachItemInSlot(this);
     }
 }
コード例 #5
0
    public GameApp()
    {
        msInstance = this;

        mEventSystem         = new EventSystem();
        mSceneManager        = new SceneManager();
        mWindowManager       = new WindowManager();
        mDataManager         = new DataManager();
        mResourceManager     = new ResourceManager();
        mToucheManager       = new TouchManager();
        mAIFactory           = new AIFactory();
        mItemManage          = new ItemManager();
        mGMHandler           = new GMHandler();
        mModuleManager       = new ModuleManager();
        mSoundManager        = new SoundManager();
        mDropManager         = new DropManager();
        mConditionManager    = new ConditionManager();
        mStageDataManager    = new StageDataManager();
        mPlayerController    = new PlayerController();
        mBloodUIManager      = new BloodUIManager();
        mBossBloodUIManager  = new BossBloodUIManager();
        mPlayerDataPool      = new PlayerDataPool();
        mYesOrNoMgr          = new YesOrNoBoxManager();
        mUIEffectMgr         = new UIEffectManager();
        mInputSystem         = new InputSystem();
        mStoryManager        = new StoryManager();
        mPromptManager       = new PromptUIManager();
        mPaoPaoManager       = new PaoPaoManager();
        mGuideManager        = new GuideManager();
        mAnimationManager    = new AnimationManager();
        mPlayerHeadUIManager = new PlayerHeadUIManager();
        mUIResourceManager   = new UIResourceManager();
        mAnnounceItemManager = new AnnounceItemManager();
        mPopTipManager       = new PopTipManager();
        mQuackUIManager      = new QuackUIManager();
        mEggManager          = new EggManager();
        mShopManager         = new ShopManager();
        mStrFilterManager    = new StrFilterManager();
        mFightGradeManager   = new FightGradeManager();
        mMailItemManager     = new MailItemManager();
        mSettingManager      = new SettingManager();
        mZhushouManager      = new ZhushouManager();
        mOtherDataPool       = new OtherDataPool();
        mActivityManager     = new ActivityManager();
        mLoadingManager      = new LoadingManager();
        mChargeItemManager   = new ChargeItemManager();
        mChargeMsgManager    = new ChargeMsgManager();
    }
コード例 #6
0
        public ServiceResult GetStagedDataTypes()
        {
            if (CurrentUser == null)
            {
                return(ServiceResponse.Error("You must be logged in to access this function."));
            }

            if (CurrentUser.RoleWeight < 92 && CurrentUser.SiteAdmin == false)
            {
                return(ServiceResponse.Error("You authorized access to this function."));
            }


            StageDataManager sdm = new StageDataManager(Globals.DBConnectionKey, "");
            var sd = sdm.GetDataTypes();

            return(ServiceResponse.OK("", sd));
        }
コード例 #7
0
        public ServiceResult GetLogs()
        {
            if (CurrentUser == null)
            {
                return(ServiceResponse.Error("You must be logged in to access this function."));
            }

            if (CurrentUser.RoleWeight < 92 && CurrentUser.SiteAdmin == false)
            {
                return(ServiceResponse.Error("You authorized access to this function."));
            }

            int count;

            DataFilter      filter = this.GetFilter(Request);
            AffliateManager al     = new AffliateManager(Globals.DBConnectionKey);

            switch (filter.ViewType?.ToLower())
            {
            case "accesslog":
                var als = al.GetAllAccessLogs(ref filter);
                return(ServiceResponse.OK("", als, filter.TotalRecordCount));

            case "requestlog":
                var rls = al.GetAllRequestLogs(ref filter);
                return(ServiceResponse.OK("", rls, filter.TotalRecordCount));

            case "systemlog":
                var sl = al.GetAllSystemLogs(ref filter);
                return(ServiceResponse.OK("", sl, filter.TotalRecordCount));

            case "stageddata":
                StageDataManager sdm = new StageDataManager(Globals.DBConnectionKey, "");
                var sd = sdm.GetAll(ref filter);
                return(ServiceResponse.OK("", sd, filter.TotalRecordCount));
            }

            return(ServiceResponse.Error("Invalid log request."));
        }
コード例 #8
0
    void Awake()
    {
        // すでに、DataManager が生成されているか
        // 生成されていなかった場合
        if (instance == null) {
            instance = this;

            clearedMaxLevel = PlayerPrefs.GetInt("CLEARED_LEVEL", 0);

            // 画面遷移のタイミングで、自分自身が Destroy されるのを防ぐ
            DontDestroyOnLoad (gameObject);

        // 生成されていた場合
        } else {

            // 自分自身(新規に追加されたオブジェクト)を消す
            Destroy (gameObject);
        }
    }
コード例 #9
0
        public ServiceResult ImportStagedItem(string uuid)
        {
            if (string.IsNullOrWhiteSpace(uuid))
            {
                return(ServiceResponse.Error("No uuid sent."));
            }

            if (CurrentUser == null)
            {
                return(ServiceResponse.Error("You must be logged in to access this function."));
            }

            if (CurrentUser.RoleWeight < 92 && CurrentUser.SiteAdmin == false)
            {
                return(ServiceResponse.Error("You authorized access to this function."));
            }


            StageDataManager sdm = new StageDataManager(Globals.DBConnectionKey, "");

            var result = sdm.Get(uuid);

            if (result.Code != 200)
            {
                return(result);
            }

            var     stagedItem = result.Result as StageData;
            dynamic stagedType = null;

            using (var context = new GreenWerxDbContext(Globals.DBConnectionKey))
            {
                switch (stagedItem.DataType)
                {
                case "account":
                    stagedType        = JsonConvert.DeserializeObject <Account>(stagedItem.StageResults);
                    stagedType.Status = "new";
                    Initialize(ref stagedType, this.CurrentUser.UUID, this.CurrentUser.AccountUUID, this.CurrentUser.RoleWeight);

                    if (!context.Insert <Account>((Account)stagedType))
                    {
                        return(ServiceResponse.Error("Failed to import item."));
                    }
                    break;
                }
                context.Delete <StageData>(stagedItem);

                var stagedAttributes = context.GetAll <StageData>().Where(w => w.DataType.EqualsIgnoreCase("attribute"));

                foreach (var stageAttribute in stagedAttributes)
                {
                    var attribute = JsonConvert.DeserializeObject <TMG.Attribute>(stageAttribute.StageResults);
                    if (attribute.ReferenceUUID == stagedType.UUID)
                    {
                        if (!context.Insert <TMG.Attribute>((TMG.Attribute)attribute))
                        {
                            stageAttribute.Result = "import failed";
                            context.Update <StageData>(stageAttribute);
                        }
                    }
                }
            }
            return(ServiceResponse.OK("", stagedType));
        }
コード例 #10
0
        public ServiceResult DeleteStagedData(string uuid)
        {
            if (CurrentUser == null)
            {
                return(ServiceResponse.Error("You must be logged in to access this function."));
            }

            if (CurrentUser.RoleWeight < 92 && CurrentUser.SiteAdmin == false)
            {
                return(ServiceResponse.Error("You authorized access to this function."));
            }

            string error = "";

            try
            {
                StageDataManager sdm = new StageDataManager(Globals.DBConnectionKey, "");
                var res = sdm.Get(uuid);
                if (res.Code != 200)
                {
                    return(res);
                }

                var result = sdm.Get(uuid);

                if (result.Code != 200)
                {
                    return(result);
                }

                var stagedItem = result.Result as StageData;


                //var delRes = sdm.Delete((INode)stagedItem);

                //if (delRes.Code != 200)
                //    return delRes;
                using (var context = new GreenWerxDbContext(Globals.DBConnectionKey))
                {
                    context.Delete <StageData>(stagedItem);

                    var stagedAttributes = context.GetAll <StageData>().Where(w => w.DataType.EqualsIgnoreCase("attribute"));

                    foreach (var stageAttribute in stagedAttributes)
                    {
                        var attribute = JsonConvert.DeserializeObject <TMG.Attribute>(stageAttribute.StageResults);
                        if (attribute.ReferenceUUID == uuid)
                        {
                            if (context.Delete <TMG.Attribute>(attribute) == false)
                            {
                                stageAttribute.Result = "delete failed";
                                context.Update <StageData>(stageAttribute);
                            }
                        }
                    }
                }

                return(ServiceResponse.OK());
            }
            catch (Exception ex)
            {
                error = ex.DeserializeException();
            }
            return(ServiceResponse.Error(error));
        }
コード例 #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StageBusinessManager"/>
 /// </summary>
 /// <param name="dataAdapter"></param>
 public StageBusinessManager(IDataAdapter <IStage> dataAdapter)
 {
     _dataManager = new StageDataManager(dataAdapter);
 }