void client1_GetStateCompleted(object sender, ServiceReference1.GetStateCompletedEventArgs e)
        {
            try
            {
                // lst2.Items.Clear();
                Dices.Clear();
                Dat.Clear();
                foreach (var item in e.Result.lastDieRoll)
                {
                    Dat.Add(new Dicies()
                    {
                        Dieces = item
                    });
                }
                Dices.Add(new Dice()
                {
                    TileName = e.Result.ActiveTileName
                });
            }

            catch (Exception ex)
            {
                //  MessageBox.Show(ex.ToString());
            }
        }
예제 #2
0
 void client_GetStateCompleted(object sender, ServiceReference1.GetStateCompletedEventArgs e)
 {
     if (location != e.Result.ActivePlayer.Location)
     {
         location = e.Result.ActivePlayer.Location;
         getLocation(e.Result.ActivePlayer.Location);
     }
     _Logs = e.Result.Log;
 }
예제 #3
0
 void client_GetStateCompleted(object sender, ServiceReference1.GetStateCompletedEventArgs e)
 {
     try
     {
         if (location != e.Result.ActivePlayer.Location)
         {
             location = e.Result.ActivePlayer.Location;
             getLocation(location);
             MessageBox.Show(location.ToString());
         }
         if (e.Result.Log != null)
         {
             Log.Clear();
             foreach (var item in e.Result.Log)
             {
                 Log.Add(item);
             }
         }
         MoneyBox.Text = "Money : " + e.Result.ActivePlayer.Cash.ToString();
     }
     catch (Exception ex)
     {
     }
 }
        void client_GetStateCompleted(object sender, ServiceReference1.GetStateCompletedEventArgs e)
        {
            try
            {
                PosData.Clear();
                PropData.Clear();
                Dice.Clear();
                if (location != e.Result.ActivePlayer.Location)
                {
                    location = e.Result.ActivePlayer.Location;
                    getLocation(location);
                    // MessageBox.Show(location.ToString());
                }
                if (e.Result.Log != null)
                {
                    Log.Clear();
                    foreach (var item in e.Result.Log)
                    {
                        Log.Add(item);
                    }
                }
                bool test = false;

                foreach (var item in e.Result.OwnedProps)
                {
                    Morguage   = item.Morguage;
                    SetLevel   = item.SetLevel;
                    HouseLevel = item.HouseLevel;
                }

                foreach (var item in localData)
                {
                    if (item.Position == location)
                    {
                        test = true;
                        string temp = null;
                        if (e.Result.IsBought[item.ID])
                        {
                            App.client.GetGamePlayerByOrderAsync((byte)e.Result.Ownership[item.ID]);
                            temp = "is al verkocht aan " + PlayerName;
                        }
                        else
                        {
                            temp = "is nog te koop";
                        }

                        PosData.Add(new PositionData()
                        {
                            Name = item.Name, Cost = item.BuyCost, Group = item.Group.ToString(), HouseCost = item.HouseCost.ToString(), Rent0 = item.Rent0, Rent1 = item.Rent1, Rent2 = item.Rent2, Rent3 = item.Rent3, Rent4 = item.Rent4, Rent5 = item.Rent5, Owner = temp
                        });
                    }

                    if (e.Result.IsBought[item.ID])
                    {
                        if (e.Result.Ownership[item.ID] == OrderNumberPlayer)
                        {
                            PropData.Add(new PositionData()
                            {
                                Cost = item.BuyCost, Group = item.Group.ToString(), HouseCost = item.HouseCost.ToString(), Name = item.Name, Rent0 = item.Rent0, Rent1 = item.Rent1, Rent2 = item.Rent2, Rent3 = item.Rent3, Rent4 = item.Rent4, Rent5 = item.Rent5, Morguage = Morguage, HouseLevel = HouseLevel, SetLevel = SetLevel
                            });
                        }
                    }
                }
                if (!test)
                {
                    PosData.Add(new PositionData()
                    {
                        Name = e.Result.ActiveTileName
                    });
                }

                foreach (var item in e.Result.lastDieRoll)
                {
                    Dice.Add(new RollDIceData()
                    {
                        DiceRoll = " Dice : " + item.ToString()
                    });
                }

                if (e.Result.ActivePlayer.IsPrison)
                {
                    EscapePrison.Visibility = Visibility.Visible;
                }

                MoneyBox.Text = "Money : " + e.Result.ActivePlayer.Cash.ToString();
            }
            catch (Exception ex)
            {
            }
        }