public PurchasesController(UserManager <User> userManager, PurchasesManager purchasesManager) : base(userManager) { _purchasesManager = purchasesManager; }
// Update is called once per frame void Update() { bool bInit = false; if (m_eStepPre != m_eStep) { m_eStepPre = m_eStep; bInit = true; } switch (m_eStep) { case STEP.IDLE: if (bInit) { m_buttonBase.TriggerClear(); } if (m_buttonBase.ButtonPushed) { m_buttonBase.TriggerClear(); //Debug.Log (m_ItemMaster.category); if (m_bAbleUse) { switch ((Define.Item.Category)m_ItemMaster.category) { case Define.Item.Category.EXPAND: m_eStep = STEP.EXPAND_CHECK; break; case Define.Item.Category.TICKET: m_eStep = STEP.TICKET_CHECK; break; case Define.Item.Category.GOLD: m_eStep = STEP.GOLD_CHECK; break; default: GameMain.Instance.PreSettingItemId = 0; SoundManager.Instance.PlaySE(SoundName.BUTTON_PUSH); GameMain.Instance.SettingItem(m_iItemId, m_iItemSerial); GameMain.Instance.SetStatus(GameMain.STATUS.PARK); break; } } } break; case STEP.EXPAND_CHECK: if (bInit) { GameObject objOjisan = PrefabManager.Instance.MakeObject("prefab/PrefOjisanCheck", gameObject.transform.parent.parent.parent.parent.gameObject); m_ojisanCheck = objOjisan.GetComponent <CtrlOjisanCheck> (); m_ojisanCheck.Initialize("動物園を\n拡張します\n\nよろしいですか"); } if (m_ojisanCheck.IsYes()) { SoundManager.Instance.PlaySE(SoundName.BUTTON_PUSH); Destroy(m_ojisanCheck.gameObject); m_eStep = STEP.EXPAND_BUY; } else if (m_ojisanCheck.IsNo()) { SoundManager.Instance.PlaySE(SoundName.BUTTON_PUSH); Destroy(m_ojisanCheck.gameObject); m_eStep = STEP.IDLE; } else { } break; case STEP.EXPAND_BUY: if (bInit) { GameObject objOjisan = PrefabManager.Instance.MakeObject("prefab/PrefOjisanCheck", gameObject.transform.parent.parent.parent.parent.gameObject); m_ojisanCheck = objOjisan.GetComponent <CtrlOjisanCheck> (); m_ojisanCheck.Initialize("拡張いたしました!", true); GameMain.dbItem.Insert(m_ItemMaster, 0, 0, 0); DataItem.OpenNewItem(m_ItemMaster.item_id); GameObject prefab = PrefabManager.Instance.PrefabLoadInstance("prefab/PrefFieldItem"); DataManager.user.AddGold(-1 * m_ItemMaster.need_coin); for (int x = 0; x < DataManager.user.m_iWidth + Define.EXPAND_FIELD + 1; x++) { for (int y = 0; y < DataManager.user.m_iHeight + Define.EXPAND_FIELD + 1; y++) { if (DataManager.user.m_iWidth <= x || DataManager.user.m_iHeight <= y) { CtrlFieldItem script = null; script = GameMain.ParkRoot.GetFieldItem(x, y); if (script == null) { GameObject obj = PrefabManager.Instance.MakeObject(prefab, GameMain.ParkRoot.gameObject); obj.name = "fielditem_" + x.ToString() + "_" + y.ToString(); script = obj.GetComponent <CtrlFieldItem> (); GameMain.ParkRoot.AddFieldItem(script); } int iDummyItemId = 0; if (x == DataManager.user.m_iWidth + Define.EXPAND_FIELD || y == DataManager.user.m_iHeight + Define.EXPAND_FIELD) { iDummyItemId = -1; } script.Init(x, y, iDummyItemId); } } } DataManager.user.m_iWidth += Define.EXPAND_FIELD; DataManager.user.m_iHeight += Define.EXPAND_FIELD; PlayerPrefs.SetInt(Define.USER_WIDTH, DataManager.user.m_iWidth); PlayerPrefs.SetInt(Define.USER_HEIGHT, DataManager.user.m_iHeight); } if (m_ojisanCheck.IsYes()) { GameMain.ListRefresh = true; Destroy(m_ojisanCheck.gameObject); m_eStep = STEP.IDLE; } break; case STEP.TICKET_CHECK: if (bInit) { string strBuyProductId = Define.GetProductId(m_ItemMaster.item_id, ref m_iTicketNum); PurchasesManager.buyItem(strBuyProductId); } if (PurchasesManager.Instance.IsPurchased()) { m_eStep = STEP.IDLE; if (PurchasesManager.Instance.Status == PurchasesManager.STATUS.SUCCESS) { m_eStep = STEP.TICKET_BUY; } } break; case STEP.TICKET_BUY: Debug.Log(string.Format("add ticket num:{0}", m_iTicketNum)); DataManager.user.AddTicket(m_iTicketNum); GameMain.Instance.HeaderRefresh(); m_eStep = STEP.IDLE; break; case STEP.GOLD_CHECK: if (bInit) { GameObject objOjisan = PrefabManager.Instance.MakeObject("prefab/PrefOjisanCheck", gameObject.transform.parent.parent.parent.parent.gameObject); m_ojisanCheck = objOjisan.GetComponent <CtrlOjisanCheck> (); m_ojisanCheck.Initialize(string.Format("チケットをゴールドに\n変換します\n\n{0}G→ {1}G\nよろしいですか", DataManager.user.m_iGold, DataManager.user.m_iGold + m_ItemMaster.add_coin)); } if (m_ojisanCheck.IsYes()) { SoundManager.Instance.PlaySE(SoundName.BUTTON_PUSH); Destroy(m_ojisanCheck.gameObject); m_eStep = STEP.GOLD_BUY; } else if (m_ojisanCheck.IsNo()) { SoundManager.Instance.PlaySE(SoundName.BUTTON_PUSH); Destroy(m_ojisanCheck.gameObject); m_eStep = STEP.IDLE; } else { } break; case STEP.GOLD_BUY: DataManager.user.AddTicket(-1 * m_ItemMaster.need_ticket); DataManager.user.AddGold(m_ItemMaster.add_coin); GameMain.Instance.HeaderRefresh(); m_eStep = STEP.IDLE; break; default: break; } return; }
public IEnumerable <PurchasesManager.NetPurchasesByIntervalLine> GetNetIncomeByInterval(DateTime initialDate, DateTime finalDate, TimeIntervalType timeInterval) { return(PurchasesManager.GetNetPurchasesByInterval(initialDate, finalDate, timeInterval)); }
public IEnumerable <PurchasesManager.PurchasesByCategoryLine> GetSalesByCategory(DateTime initialDate, DateTime finalDate, Int32 limit) { return(PurchasesManager.GetPurchasesByCategory(initialDate, finalDate, limit)); }
public IEnumerable <PurchasesManager.TopProductsLine> getTopProducts(DateTime initialDate, DateTime finalDate, Int32 limit) { return(PurchasesManager.GetTopProducts(initialDate, finalDate, limit)); }
public IEnumerable <PurchasesManager.TopSuppliersLine> GetTopCostumers(DateTime initialDate, DateTime finalDate, Int32 limit) { return(PurchasesManager.GetTopSuppliers(initialDate, finalDate, limit)); }
public Double GetNetIncome(DateTime initialDate, DateTime finalDate) { return(PurchasesManager.GetNetPurchases(initialDate, finalDate)); }