Inheritance: BaseModel
コード例 #1
0
        private void btnAddCooperation_Click(object sender, RoutedEventArgs e)
        {
            object o = PopUpAddCooperation.ShowPopUp(GameObject.GetInstance().HumanAirline, Airport.Airport);

            if (o != null && o is CooperationType)
            {
                var type = (CooperationType)o;

                if (type.Price < GameObject.GetInstance().HumanAirline.Money)
                {
                    var cooperation = new Cooperation(
                        type,
                        GameObject.GetInstance().HumanAirline,
                        GameObject.GetInstance().GameTime);

                    Airport.addCooperation(cooperation);
                }
                else
                {
                    WPFMessageBox.Show(
                        Translator.GetInstance().GetString("MessageBox", "2232"),
                        string.Format(Translator.GetInstance().GetString("MessageBox", "2232", "message")),
                        WPFMessageBoxButtons.Ok);
                }
            }
        }
コード例 #2
0
 public void RemoveCooperation(Cooperation cooperation)
 {
     Cooperations.Remove(cooperation);
 }
コード例 #3
0
 public void AddCooperation(Cooperation cooperation)
 {
     Cooperations.Add(cooperation);
 }
コード例 #4
0
 public CooperationMVVM(Airport airport, Cooperation cooperation)
 {
     Airport = airport;
     Cooperation = cooperation;
 }
コード例 #5
0
 public void removeCooperation(Cooperation cooperation)
 {
     Cooperations.Remove(cooperation);
     Airport.RemoveCooperation(cooperation);
 }
コード例 #6
0
        //removes an airline contract from the airport
        //adds a cooperation to the airport
        public void addCooperation(Cooperation cooperation)
        {
            Cooperations.Add(cooperation);
            Airport.AddCooperation(cooperation);

            AirlineHelpers.AddAirlineInvoice(
                cooperation.Airline,
                cooperation.BuiltDate,
                Invoice.InvoiceType.Purchases,
                -cooperation.Type.Price);
        }