示例#1
0
 public override void OnAction(CityBuildingAction action, CityView cityView)
 {
     cityV  = cityView;
     player = cityV.player;
     Trace.TraceInformation($"Store::OnAction {action.name}");
     if (action.name == "Deselect")
     {
         cityV.actionOptionLabel.Visible = false;
         cityV.button1.Visible           = false;
     }
     else if (action.name == "Work")
     {
         cityV.actionOptionLabel.Visible = false;
         Skill skill   = (player.GetTree("Woodcutter") as Skill);
         int   payment = GetPayment(skill);
         cityV.actionOptionLabel.Text = $"You can work for the day as a logger for {payment} coins.";
         cityV.button1.Visible        = true;
         cityV.button1.Text           = "Work";
         cityV.button1.Click         += Button1_Click;
     }
 }
示例#2
0
 public override void OnAction(CityBuildingAction action, CityView cityView)
 {
     cityV = cityView;
     Trace.TraceInformation($"Store::OnAction {action.name}");
     if (action.name == "Deselect")
     {
         cityV.actionOptionLabel.Visible   = false;
         cityView.actionOptionList.Visible = false;
         cityView.actionOptionList.SelectedIndexChanged -= ActionOptionList_SelectedIndexChanged;
     }
     else if (action.name == "Fast Travel")
     {
         cityView.actionOptionList.Visible = true;
         cityV.actionOptionList.Items.Clear();
         cityV.actionOptionLabel.Visible = false;
         foreach (var c in city.portConnections)
         {
             cityV.actionOptionList.Items.Add(c);
         }
         cityView.actionOptionList.SelectedIndexChanged += ActionOptionList_SelectedIndexChanged;
     }
 }
示例#3
0
文件: Store.cs 项目: quajak/StartGame
        public override void OnAction(CityBuildingAction action, CityView cityView)
        {
            Trace.TraceInformation($"Store::OnAction {action.name}");
            this.cityView = cityView;
            if (action.name == "Buy")
            {
                cityView.actionOptionList.Visible = true;
                cityView.actionOptionList.Items.Clear();
                foreach (var item in Items)
                {
                    cityView.actionOptionList.Items.Add(item);
                }
                cityView.actionOptionList.SelectedIndexChanged += ActionOptionList_SelectedIndexChanged;
            }
            else if (action.name == "Deselect")
            {
                cityView.actionOptionList.Visible = false;
                cityView.button1.Visible          = false;
                cityView.button1.MouseClick      -= Button1_MouseClickSell;

                cityView.button1.MouseClick -= Buy_MouseClick;
                cityView.button1.MouseClick -= Button1_MouseClickSell;
                cityView.actionOptionList.SelectedIndexChanged -= ActionOptionList_SelectedIndexChanged;
                cityView.actionOptionList.SelectedIndexChanged -= ActionOptionList_SelectedIndexChangedSell;
            }
            else if (action.name == "Sell")
            {
                cityView.actionOptionList.Visible = true;
                cityView.actionOptionList.Items.Clear();
                foreach (var item in cityView.player.troop.Items)
                {
                    cityView.actionOptionList.Items.Add(item);
                }
                cityView.actionOptionList.SelectedIndexChanged += ActionOptionList_SelectedIndexChangedSell;
            }
        }
示例#4
0
 public virtual void OnAction(CityBuildingAction action, CityView cityView)
 {
 }