Example #1
0
 public apiEventArgs(player pl)
 {
     Player = pl;
 }
Example #2
0
        private void refScreen(player pla)
        {
            lblStation.Content    = pla.Station;
            lblStarSystem.Content = pla.StarSystem;
            lblDocked.Content     = pla.Docked;
            lblShip.Content       = pla.Ship;
            lblLoadFSD.Content    = pla.LoadFSD;
            lblTrack.Content      = pla.Track;
            lblGameMode.Content   = pla.GameMode;
            string cargo = pla.Cargo + "/" + pla.CargoSpace;

            lblCargo.Content = cargo;
            string pass = pla.Passenger + "/" + pla.PassengerCabbin;

            lblPassengers.Content = pass;


            if (COM.IsOpen)
            {
                string line = "";
                //pla.StarSystem                    pla.Station
                int    space  = 20 - (pla.StarSystem.Length + pla.Station.Length);
                string spacer = " - ";
                if (space > 3)
                {
                    spacer = "";
                    for (int i = 0; i < space; i++)
                    {
                        spacer += i == space / 2 ? "-" : " ";
                    }
                }
                if (pla.Station == "")
                {
                    line = pla.StarSystem.PadRight(20);
                }
                else
                {
                    line = pla.StarSystem + spacer + pla.Station;
                }

                if (line != lines[0])
                {
                    lines[0] = line;
                    COM.WriteLine("0" + line);
                }

                string type = ((pla.Docked == "undocked") && (pla.Track == "Supercruise")) || (pla.LoadFSD == "LoadFSD") ? pla.StarClass : pla.Docked;
                line = (type + " ").PadRight(20 - (pla.Track.Length > 19 ? 19 : pla.Track.Length)) + pla.Track;

                if (line != lines[1])
                {
                    Thread.Sleep(50);
                    lines[1] = line;
                    COM.WriteLine("1" + line);
                }

                string right = pla.LoadFSD == "" ? pla.GameMode : pla.LoadFSD;
                line = (pla.Ship + " ").PadRight(20 - (pla.LoadFSD.Length > 19 ? 19 : right.Length)) + right;

                if (line != lines[2])
                {
                    Thread.Sleep(50);
                    lines[2] = line;
                    COM.WriteLine("2" + line);
                }

                string passeng = "";
                if (pla.PassengerCabbin > 0)
                {
                    passeng = pass;
                }
                line = (passeng + " ").PadRight(20 - cargo.Length) + cargo;

                if (line != lines[3])
                {
                    Thread.Sleep(50);
                    lines[3] = line;
                    COM.WriteLine("3" + line);
                }
            }
            pl = pla;
        }