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); }
public static StageDataManager GetInstance() { if (!instance) { container = new GameObject("StageDataManager"); instance = container.AddComponent <StageDataManager>(); } return(instance); }
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); }
private void OnTriggerEnter2D(Collider2D col) { if (col.tag == "PLAYER") { playerTrans = col.gameObject.transform; gameObject.SetActive(false); StageDataManager.GetInstance().HaveKey += 1; ItemSlotManager.GetInstance().AttachItemInSlot(this); } }
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(); }
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)); }
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.")); }
void Awake() { // すでに、DataManager が生成されているか // 生成されていなかった場合 if (instance == null) { instance = this; clearedMaxLevel = PlayerPrefs.GetInt("CLEARED_LEVEL", 0); // 画面遷移のタイミングで、自分自身が Destroy されるのを防ぐ DontDestroyOnLoad (gameObject); // 生成されていた場合 } else { // 自分自身(新規に追加されたオブジェクト)を消す Destroy (gameObject); } }
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)); }
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)); }
/// <summary> /// Initializes a new instance of the <see cref="StageBusinessManager"/> /// </summary> /// <param name="dataAdapter"></param> public StageBusinessManager(IDataAdapter <IStage> dataAdapter) { _dataManager = new StageDataManager(dataAdapter); }