Пример #1
0
 public subForm(DrinkData drink)
 {
     InitializeComponent();
     Bind();
     confirm.DialogResult = DialogResult.OK;
     this.drink           = drink;
 }
Пример #2
0
    private void Awake()
    {
        instance = this;
        List <string[]> tagDataList = InstanceLoad.GetInstanceData("Texts/TagData");

        foreach (string[] insDataArr in tagDataList)
        {
            Tag tag = new Tag(int.Parse(insDataArr[0]), insDataArr[1], insDataArr[2]);
            tags.Add(tag);
        }
        List <string[]> drinkDataList = InstanceLoad.GetInstanceData("Texts/DrinkData");

        foreach (string[] insDataArr in drinkDataList)
        {
            DrinkInfo drink = new DrinkInfo(int.Parse(insDataArr[0]), int.Parse(insDataArr[1]), insDataArr[2], insDataArr[3]);
            drinks.Add(drink);
        }
        List <string[]> drinkTagList = InstanceLoad.GetInstanceData("Texts/DrinkTagData");

        foreach (string[] insDataArr in drinkTagList)
        {
            DrinkTag drinkTag = new DrinkTag(int.Parse(insDataArr[0].ToString().Trim()), insDataArr[1], insDataArr[2], insDataArr[3]);
            drinkTags.Add(drinkTag);
        }
    }
Пример #3
0
 public void SetUp()
 {
     m_obj                  = new GameObject("MenuBoardObject");
     drinkData              = m_obj.AddComponent <DrinkData>();
     menuManager            = m_obj.AddComponent <MenuManager>();
     menuManager.buttonPreb = Resources.Load <GameObject>("Prefabs/DrinkNameButton");
 }
Пример #4
0
 public void SetUp()
 {
     m_obj       = new GameObject("TestGameObject");
     drinkData   = m_obj.AddComponent <DrinkData>();
     itemManager = m_obj.AddComponent <ItemManager>();
     itemManager.Awake();
     drinkData.itemData = itemManager.itemData;
 }
Пример #5
0
    public void Reset()
    {
        drink = null;
        insertedMoney.Clear();
        oddMoneyToReturn.Clear();
        paidMoney    = 0f;
        drinkCreated = false;

        GameManager.Instance.moneyDisplay.UpdateDisplay(0f);
        GameManager.Instance.drinkSelection.SelectPlaceholder();
    }
Пример #6
0
 public Form2(DrinkData drink)
 {
     InitializeComponent();
     this.drink = drink;
     //先這樣
     //List<string> a = new List<string>();
     //listType.AddRange(drink.Sugar.ToList() ?? a);
     //listType.AddRange(drink.Ice.ToList());
     //listType.AddRange(drink.Size.ToList());
     confirm.DialogResult = DialogResult.OK;
     Bind();
     //註冊計算價格事件
     this.TotalMoney += new MoneyCalculate(GetPrice);
 }
Пример #7
0
        public async Task <DrinkData> GetLastReviewedDrink(string username)
        {
            var activities =
                await _activitiesRepository.Get(x => x.Username == username && x.Action == PerformedAction.AddedReview);

            var drinkData = new DrinkData();

            if (activities.Count.Equals(0))
            {
                drinkData.DrinkId   = null;
                drinkData.DrinkName = "none";
            }
            else
            {
                var lastlyReviewedDrink = activities.OrderByDescending(x => x.Created).First();
                drinkData.DrinkId   = lastlyReviewedDrink.DrinkId;
                drinkData.DrinkName = lastlyReviewedDrink.DrinkName;
            }
            return(drinkData);
        }
Пример #8
0
        public async Task OnGetAsync(int?id, int?categoryID)
        {
            Drink = await _context.Drink.Include(b => b.Store).ToListAsync();

            DrinkD        = new DrinkData();
            DrinkD.Drinks = await _context.Drink
                            .Include(b => b.Store)
                            .Include(b => b.DrinkCategories)
                            .ThenInclude(b => b.Category)
                            .AsNoTracking()
                            .OrderBy(b => b.Name)
                            .ToListAsync();

            if (id != null)
            {
                DrinkID = id.Value;
                Drink drink = DrinkD.Drinks.Where(i => i.ID == id.Value).Single();
                DrinkD.Catetegories = drink.DrinkCategories.Select(S => S.Category);
            }
        }
Пример #9
0
        public override void Button_Click(object sender, EventArgs e)
        {
            Button  btn     = (Button)sender;
            BtnData btnData = btnDatas.Where(x => x.Text == btn.Text).SingleOrDefault();

            if (btnData == null)
            {
                return;
            }
            //創建 飲料物件
            drinkdata = new DrinkData(btnData);
            Form2 form2 = new Form2(drinkdata);

            this.Enabled = false;
            if (form2.ShowDialog() == DialogResult.OK)
            {
                //ListViewItem lvi = new ListViewItem(form2.lvItem);
                //listView1.Items.Add(lvi);
                SetList();
                DoCalculate();
            }
            this.Enabled = true;
        }
Пример #10
0
 public DrinkController(IOptions <AppSettings> appSettings)
 {
     _drinkAgent = new DrinkData(appSettings.Value);
 }
Пример #11
0
 public override void SelectDrink(DrinkData drink)
 {
     stateData.Drink = drink;
 }
Пример #12
0
 public GameObject CreateDrinkGameObject(DrinkData drink)
 {
     return(CreateUIElement(drink.prefab));
 }
Пример #13
0
 private void OnSelectListener(int index)
 {
     SelectedDrink = index > 0 ? drinks[index - 1] : null;
     GameManager.Instance.moneyDisplay.UpdateDisplay(SelectedDrink.price);
 }
Пример #14
0
 public DrinkController()
 {
     _data = new DrinkData();
 }
Пример #15
0
 /* StateActions */
 public virtual void SelectDrink(DrinkData drink)
 {
     Debug.Log("Not implemented.");
 }