Ejemplo n.º 1
0
        public IHttpActionResult Add(Sit sit)
        {
            if (sit == null)
            {
                return(BadRequest("null object"));
            }

            if (_context.Sits.Where(s => s.GenderId == sit.GenderId).ToList().Select(s => s.Name).Contains(sit.Name))
            {
                return(BadRequest("Already exist"));
            }

            if (sit.Id == 0)
            {
                _context.Sits.Add(sit);
            }
            else
            {
                var sitInDb = _context.Sits.SingleOrDefault(s => s.Id == sit.Id);
                if (sitInDb == null)
                {
                    return(BadRequest("null object"));
                }
                sitInDb.GenderId = sit.GenderId;
                sitInDb.Name     = sit.Name;
                sitInDb.Capacity = sit.Capacity;
            }

            _context.SaveChanges();

            return(Ok(sit));
        }
Ejemplo n.º 2
0
 private void Stand_Click(object sender, EventArgs e)
 {
     I.Write("Fold$");
     Thread.Sleep(500);
     I.Write("Stand$");
     Stand.Hide();
     Sit.Show();
 }
Ejemplo n.º 3
0
        public ActionResult DeleteConfirmed(int id)
        {
            Sit sit = db.Sits.Find(id);

            db.Sits.Remove(sit);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "SitID,SitKind,SitName")] Sit sit)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sit).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sit));
 }
Ejemplo n.º 5
0
        public ActionResult Create([Bind(Include = "SitID,SitKind,SitName")] Sit sit)
        {
            if (ModelState.IsValid)
            {
                db.Sits.Add(sit);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sit));
        }
Ejemplo n.º 6
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Sit sit = db.Sits.Find(id);

            if (sit == null)
            {
                return(HttpNotFound());
            }
            return(View(sit));
        }
Ejemplo n.º 7
0
    public override void Update()
    {
        walkCount += Time.deltaTime;
        GoToDestination(des, walkSpeed);
        if (walkCount > 4.0f || GoalReached(doggy.transform.position, des))
        {
            if (Random.Range(0f, 100.0f) < 20.0f)
            {
                nextState = new Sit(doggy, anim);
                stage     = EVENT.EXIT;
            }
            walkCount = 0f;
            des       = RandomDestination();
        }


        if (Random.Range(0f, 1000.0f) < 1.0f)
        {
            nextState = new Pee(doggy, anim);
            stage     = EVENT.EXIT;
        }
    }
Ejemplo n.º 8
0
        static void Main(string[] args)
        {
            string inFileName;
            string outFileName;

            if (args.Length != 2 || !File.Exists(inFileName = args[0]))
            {
                Console.WriteLine("Usage: progName <input filename> <output filename>");
                return;
            }

            outFileName = args[1];

            StreamReader sr = new StreamReader(inFileName);
            StreamWriter sw = new StreamWriter(new FileStream(outFileName, FileMode.Create));
            sw.WriteLine();

            int zpracovanoGrafu = 0;
            Dictionary<int, int> grafy2PoctyFazi = new Dictionary<int, int>(),
                                 grafy2PoctyGrafu = new Dictionary<int, int>();

            while (!sr.EndOfStream)
            {
                string graphString = sr.ReadLine().Trim();
                if (graphString.Length == 0)
                    continue;

                Sit sit = new Sit(graphString);
                DinitzRunSummary summary = sit.SpoctiMaximalniTok();

                int pocetVrcholu = summary.PocetVrcholu,
                    pocetFazi = summary.PocetFazi;

                if (!grafy2PoctyGrafu.ContainsKey(pocetVrcholu))
                {
                    grafy2PoctyGrafu.Add(pocetVrcholu, 0);
                    grafy2PoctyFazi.Add(pocetVrcholu, 0);
                }

                int staryPocetFazi = grafy2PoctyFazi[pocetVrcholu];

                grafy2PoctyGrafu[pocetVrcholu] = grafy2PoctyGrafu[pocetVrcholu] + 1;
                grafy2PoctyFazi[pocetVrcholu] = Math.Max(staryPocetFazi, pocetFazi);

                Console.WriteLine("Zpracovano grafu: {0}", ++zpracovanoGrafu);
                #if(INDIVIDUALGRAPHS)
                sw.WriteLine(summary.ToString());
                #endif
            }

            //sw.WriteLine();

            foreach(KeyValuePair<int, int> velikostGrafuPocetGrafu in grafy2PoctyGrafu)
            {
                sw.WriteLine("Velikost grafu ve skupine: {0}\tPocet grafu: {1}\tOcekavany nejhorsi pocet fazi: {2}\tNamereny nejhorsi pocet fazi: {3}",
                    new object[]{velikostGrafuPocetGrafu.Key,
                        velikostGrafuPocetGrafu.Value,
                        Math.Sqrt(velikostGrafuPocetGrafu.Key),
                        (double)grafy2PoctyFazi[velikostGrafuPocetGrafu.Key]});
            }

            Console.WriteLine("Done");

            sr.Close();
            sw.Close();

            Console.ReadLine();
        }
Ejemplo n.º 9
0
        private static int ProcessMessage(int messageIndex)
        {
            Sims3.SimIFace.StopWatch stopWatch = Sims3.SimIFace.StopWatch.Create(Sims3.SimIFace.StopWatch.TickStyles.Milliseconds);
            stopWatch.Start();

            uint message = 0;

            stopWatch.SetElapsedTime(10);
            int readIndex = messageIndex;

            while (message == 0)
            {
                try { message = BitConverter.ToUInt32(messageBuffer, readIndex); readIndex += intSize; }
                catch { }
                while (stopWatch.GetElapsedTime() < 10)
                {
                }
                stopWatch.Restart();
            }

            if (message == (uint)MessageIDs.HandShakeRequest)
            {
                byte[] comfirmBytes = BitConverter.GetBytes((uint)MessageIDs.HandShakeComfirm);
                sendBuffer.Add(comfirmBytes);
                bufferConnected = true;
            }
            else if (message == (uint)MessageIDs.StartGame)
            {
                Sims3.Gameplay.Gameflow.SetGameSpeed(Sims3.SimIFace.Gameflow.GameSpeed.Normal, Sims3.Gameplay.Gameflow.SetGameSpeedContext.GameStates);
                gameStarted = true;
            }
            else if (message == (uint)MessageIDs.GameFlowNormal)
            {
                Sims3.Gameplay.Gameflow.SetGameSpeed(Sims3.SimIFace.Gameflow.GameSpeed.Normal, Sims3.Gameplay.Gameflow.SetGameSpeedContext.GameStates);
            }
            else if (message == (uint)MessageIDs.GameFlowPause)
            {
                Sims3.Gameplay.Gameflow.SetGameSpeed(Sims3.SimIFace.Gameflow.GameSpeed.Pause, Sims3.Gameplay.Gameflow.SetGameSpeedContext.GameStates);
            }
            else if (message == (uint)MessageIDs.InteractionTerrain)
            {
                uint type = BitConverter.ToUInt32(messageBuffer, readIndex); readIndex += intSize;
                if (type == (uint)InteractionTerrainTypes.GoHereSameLot)
                {
                    ulong targetID = BitConverter.ToUInt64(messageBuffer, readIndex); readIndex += longSize;
                    float x        = BitConverter.ToSingle(messageBuffer, readIndex); readIndex += sizeof(float);
                    float y        = BitConverter.ToSingle(messageBuffer, readIndex); readIndex += sizeof(float);
                    float z        = BitConverter.ToSingle(messageBuffer, readIndex); readIndex += sizeof(float);

                    InteractionPriority priority = new InteractionPriority();
                    priority.Level = InteractionPriorityLevel.UserDirected;
                    ObjectGuid guid = new ObjectGuid();
                    guid.Value  = targetID;
                    guid.mValue = targetID;
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(Terrain.GoHere.SameLotSingleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    Terrain.GoHere gohere = new Terrain.GoHere();
                    gohere.Init(ref paras);
                    gohere.SetTargetPosition(new Vector3(x, y, z));
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(gohere);
                }
            }
            else if (message == (uint)MessageIDs.InteractionShared)
            {
                uint  type     = BitConverter.ToUInt32(messageBuffer, readIndex); readIndex += intSize;
                ulong targetID = BitConverter.ToUInt64(messageBuffer, readIndex); readIndex += longSize;
                InteractionPriority priority = new InteractionPriority();
                priority.Level = InteractionPriorityLevel.UserDirected;
                ObjectGuid guid = new ObjectGuid();
                guid.Value  = targetID;
                guid.mValue = targetID;

                if (type == (uint)InteractionSharedTypes.JumpOnObject)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(JumpOnObject.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    JumpOnObject interaction            = new JumpOnObject();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.JumpOffObject)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(JumpOffObject.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    JumpOffObject interaction           = new JumpOffObject();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.SleepAndNapOnObject)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(SleepAndNapOnObject.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras       = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    SleepAndNapOnObject           interaction = new SleepAndNapOnObject();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.StretchOnObject)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(StretchOnObject.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    StretchOnObject interaction         = new StretchOnObject();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.ShooOff)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(ShooOff.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    ShooOff interaction = new ShooOff();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.ShooNeighborPet)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(ShooNeighborPet.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    ShooNeighborPet interaction         = new ShooNeighborPet();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.ShooFromFood)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(ShooFromFood.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    ShooFromFood interaction            = new ShooFromFood();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.ScratchObject)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(ScratchObject.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    ScratchObject interaction           = new ScratchObject();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.PetSingAlong)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(PetSingAlong.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    PetSingAlong interaction            = new PetSingAlong();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.ReactToDisturbance)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(ReactToDisturbance.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras       = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    ReactToDisturbance            interaction = new ReactToDisturbance();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.Sit)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(Sit.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    Sit interaction = new Sit();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.Stand)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(Stand.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    Stand interaction = new Stand();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.ViewObjects)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(ViewObjects.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    ViewObjects interaction             = new ViewObjects();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.Reminisce)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(Reminisce.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    Reminisce interaction = new Reminisce();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
                else if (type == (uint)InteractionSharedTypes.CatchFlies)
                {
                    Sims3.Gameplay.Autonomy.InteractionObjectPair iop = new Sims3.Gameplay.Autonomy.InteractionObjectPair(CatchFlies.Singleton, Terrain.GetObject(guid));
                    InteractionInstanceParameters paras = new InteractionInstanceParameters(iop, Sims3.Gameplay.Actors.Sim.ActiveActor, priority, false, true);
                    CatchFlies interaction = new CatchFlies();
                    interaction.Init(ref paras);
                    netIntercactionAdded = true;
                    Sims3.Gameplay.Actors.Sim.ActiveActor.InteractionQueue.Add(interaction);
                }
            }
            else
            {
                return(-1);
            }
            return(readIndex);
        }
Ejemplo n.º 10
0
        public void Process(string a)
        {
            string[] command = new string[6];
            for (int i = 0; a.IndexOf('$') != -1; i++)
            {
                command[i] = a.Substring(0, a.IndexOf('$'));
                a          = a.Remove(0, a.IndexOf('$') + 1);
            }
            if (command[0] == "Joined") // Joined$position$name$money$
            {
                int pos = int.Parse(command[1]);
                players[pos].Name  = command[2];
                players[pos].Money = int.Parse(command[3]);
            }
            else if (command[0] == "Sitting") // Sitting$position$name$money$
            {
                int pos = int.Parse(command[1]);
                players[pos].Name  = command[2];
                players[pos].Money = int.Parse(command[3]);
                players[pos].Pocket0.Show();
                players[pos].Pocket1.Show();
            }
            else if (command[0] == "Left") // Left$position$
            {
                int pos = int.Parse(command[1]);
                players[pos].Name = "Open";
                players[pos].MoneyAsControl.Text = "Seat";
                players[pos].Pocket0.Hide();
                players[pos].Pocket1.Hide();
                players[pos].Action.Hide();
            }

            else if (command[0] == "Pocket") // Pocket$id$number(2-14)$shape(1-4)$
            {
                Image Card = Image.FromFile("Data\\" + int.Parse(command[2]) + "_" + int.Parse(command[3]) + ".gif");
                if (command[1] == "0")
                {
                    Pocket0.BackgroundImage = Card;
                    Pocket0.Show();
                }
                else
                {
                    Pocket1.BackgroundImage = Card;
                    Pocket1.Show();
                }
            }
            else if (command[0] == "Community") // Community$id$number(2-14)$shape(1-4)$
            {
                Image Card = Image.FromFile("Data\\" + int.Parse(command[2]) + "_" + int.Parse(command[3]) + ".gif");
                switch (command[1])
                {
                case "0":
                    Community0.BackgroundImage = Card;
                    Community0.Show();
                    break;

                case "1":
                    Community1.BackgroundImage = Card;
                    Community1.Show();
                    break;

                case "2":
                    Community2.BackgroundImage = Card;
                    Community2.Show();
                    break;

                case "3":
                    Community3.BackgroundImage = Card;
                    Community3.Show();
                    break;

                default:
                    Community4.BackgroundImage = Card;
                    Community4.Show();
                    break;
                }
            }
            else if (command[0] == "Hand") // Hand$position$number(2-14)$shape(1-4)$number(2-14)$shape(1-4)$
            {
                int pos = int.Parse(command[1]);
                players[pos].Pocket0.BackgroundImage = Image.FromFile("Data\\" + int.Parse(command[2]) + "_" + int.Parse(command[3]) + ".gif");
                players[pos].Pocket1.BackgroundImage = Image.FromFile("Data\\" + int.Parse(command[4]) + "_" + int.Parse(command[5]) + ".gif");
            }
            else if (command[0] == "Win") // Win$position$pot$
            {
                int pos    = int.Parse(command[1]);
                int amount = int.Parse(command[2]);
                players[pos].Money += amount;
                if (players[pos].Name == I.Name)
                {
                    I.Money += amount;
                }
                Pot.Text = "0";
                foreach (Player p in players)
                {
                    p.Pocket0.BackgroundImage = Image.FromFile("Data\\back.jpg");
                    players[pos].Pocket0.Show();
                    p.Pocket1.BackgroundImage = Image.FromFile("Data\\back.jpg");
                    players[pos].Pocket1.Show();
                    players[pos].Action.Hide();
                }
                players[button].Button.Hide();
                Community0.Hide();
                Community1.Hide();
                Community2.Hide();
                Community3.Hide();
                Community4.Hide();
                Pocket0.Hide();
                Pocket1.Hide();
            }


            else if (command[0] == "Kick") // Kick$
            {
                I.Write("Stand$");
                Stand.Hide();
                Sit.Show();
            }
        }
Ejemplo n.º 11
0
 private void Sit_Click(object sender, EventArgs e)
 {
     I.Write("Sit$");
     Sit.Hide();
     Stand.Show();
 }
Ejemplo n.º 12
0
 public CinemaSitViewModel(Sit sit)
 {
     Sit       = sit;
     IsEnabled = !Sit.IsFull;
 }
Ejemplo n.º 13
0
        public void Process(string a)
        {
            string[] command = new string[6];
            for (int i = 0; a.IndexOf('$') != -1; i++)
            {
                command[i] = a.Substring(0, a.IndexOf('$'));
                a          = a.Remove(0, a.IndexOf('$') + 1);
            }
            if (command[0] == "Joined") // Joined$position$name$money$
            {
                int pos = int.Parse(command[1]);
                players[pos].Name  = command[2];
                players[pos].Money = int.Parse(command[3]);
                Write(players[pos].Name + " has joined the table with " + players[pos].Money + "$");
            }
            else if (command[0] == "Sitting") // Sitting$position$name$money$
            {
                int pos = int.Parse(command[1]);
                players[pos].Name  = command[2];
                players[pos].Money = int.Parse(command[3]);
                players[pos].Pocket0.Show();
                players[pos].Pocket1.Show();
            }
            else if (command[0] == "Left") // Left$position$
            {
                int pos = int.Parse(command[1]);
                Write(players[pos].Name + " has left the table");
                players[pos].Name = "Open";
                players[pos].MoneyAsControl.Text = "Seat";
                players[pos].Pocket0.Hide();
                players[pos].Pocket1.Hide();
                players[pos].Action.Hide();
            }
            else if (command[0] == "Button") // Button$position$
            {
                int pos = int.Parse(command[1]);
                if (button == 0)
                {
                    Write(players[pos].Name + " has been randomly chosen to be the dealer");
                }
                button = pos;
                players[button].Button.Show();
            }
            else if (command[0] == "Dealer") // Dealer$position$
            {
                button = int.Parse(command[1]);
                players[button].Button.Show();
                foreach (Player p in players)
                {
                    if (p.Name != "Open")
                    {
                        p.Pocket0.Show();
                        p.Pocket1.Show();
                    }
                }
            }
            else if (command[0] == "SmallBlind") // SmallBlind$position$amount$
            {
                int pos    = int.Parse(command[1]);
                int amount = int.Parse(command[2]);
                players[pos].Money -= amount;
                if (players[pos].Name == I.Name)
                {
                    I.Money -= amount;
                }
                Pot.Text = (int.Parse(Pot.Text) + amount) + "";
                Write(players[pos].Name + " has submitted a small blind of " + amount);
            }
            else if (command[0] == "BigBlind") // BigBlind$position$amount$
            {
                int pos    = int.Parse(command[1]);
                int amount = int.Parse(command[2]);
                bb = amount;
                players[pos].Money -= amount;
                if (players[pos].Name == I.Name)
                {
                    I.Money -= amount;
                }
                Pot.Text = (int.Parse(Pot.Text) + amount) + "";
                Write(players[pos].Name + " has submitted a big blind of " + amount);
            }
            else if (command[0] == "Pocket") // Pocket$id$number(2-14)$shape(1-4)$
            {
                Image Card = Image.FromFile("Data\\" + int.Parse(command[2]) + "_" + int.Parse(command[3]) + ".gif");
                if (command[1] == "0")
                {
                    Pocket0.BackgroundImage = Card;
                    Pocket0.Show();
                    Write("Pocket Card 1: " + Number(command[2]) + Shape(command[3]));
                }
                else
                {
                    Pocket1.BackgroundImage = Card;
                    Pocket1.Show();
                    Write("Pocket Card 2: " + Number(command[2]) + Shape(command[3]));
                }
            }
            else if (command[0] == "Community") // Community$id$number(2-14)$shape(1-4)$
            {
                Image Card = Image.FromFile("Data\\" + int.Parse(command[2]) + "_" + int.Parse(command[3]) + ".gif");
                switch (command[1])
                {
                case "0":
                    Community0.BackgroundImage = Card;
                    Community0.Show();
                    Write("Community Card 1: " + Number(command[2]) + Shape(command[3]));
                    break;

                case "1":
                    Community1.BackgroundImage = Card;
                    Community1.Show();
                    Write("Community Card 2: " + Number(command[2]) + Shape(command[3]));
                    break;

                case "2":
                    Community2.BackgroundImage = Card;
                    Community2.Show();
                    Write("Community Card 3: " + Number(command[2]) + Shape(command[3]));
                    break;

                case "3":
                    Community3.BackgroundImage = Card;
                    Community3.Show();
                    Write("Community Card 4: " + Number(command[2]) + Shape(command[3]));
                    break;

                default:
                    Community4.BackgroundImage = Card;
                    Community4.Show();
                    Write("Community Card 5: " + Number(command[2]) + Shape(command[3]));
                    break;
                }
            }
            else if (command[0] == "Hand") // Hand$position$number(2-14)$shape(1-4)$number(2-14)$shape(1-4)$
            {
                int pos = int.Parse(command[1]);
                players[pos].Pocket0.BackgroundImage = Image.FromFile("Data\\" + int.Parse(command[2]) + "_" + int.Parse(command[3]) + ".gif");
                players[pos].Pocket1.BackgroundImage = Image.FromFile("Data\\" + int.Parse(command[4]) + "_" + int.Parse(command[5]) + ".gif");
                Write(players[pos].Name + " shows " + Number(command[2]) + Shape(command[3]) + " " + Number(command[4]) + Shape(command[5]));
            }
            else if (command[0] == "Win") // Win$position$pot$
            {
                int pos    = int.Parse(command[1]);
                int amount = int.Parse(command[2]);
                players[pos].Money += amount;
                if (players[pos].Name == I.Name)
                {
                    I.Money += amount;
                }
                Write(players[pos].Name + " wins a pot of " + amount + "$");
                Pot.Text = "0";
                foreach (Player p in players)
                {
                    p.Pocket0.BackgroundImage = Image.FromFile("Data\\back.jpg");
                    players[pos].Pocket0.Show();
                    p.Pocket1.BackgroundImage = Image.FromFile("Data\\back.jpg");
                    players[pos].Pocket1.Show();
                    players[pos].Action.Hide();
                }
                players[button].Button.Hide();
                HideButtons();
                Community0.Hide();
                Community1.Hide();
                Community2.Hide();
                Community3.Hide();
                Community4.Hide();
                Pocket0.Hide();
                Pocket1.Hide();
            }
            else if (command[0] == "SidePot") // SidePot$position$amount
            {
                int pos    = int.Parse(command[1]);
                int amount = int.Parse(command[2]);
                players[pos].Money += amount;
                if (players[pos].Name == I.Name)
                {
                    I.Money += amount;
                }
                Write(players[pos].Name + " wins a side pot of " + amount + "$");
                Pot.Text = (int.Parse(Pot.Text) - amount) + "";
            }
            else if (command[0] == "Playing") // Playing$position
            {
                players[int.Parse(command[1])].Action.Show();
            }
            else if (command[0] == "Waiting") // Waiting$bet$inroundmoney$
            {
                int bet     = int.Parse(command[1]);
                int inround = int.Parse(command[2]);
                int tmp;
                if (bet - inround != 0)
                {
                    Call.Text  = "Call " + (bet - inround);
                    Raise.Text = "Raise";
                    tmp        = 2 * bet - inround;
                }
                else
                {
                    Call.Text  = "Check";
                    Raise.Text = "Bet";
                    tmp        = bb - inround;
                }
                RaiseAmount.Text     = tmp + "";
                RaiseBar.Minimum     = tmp;
                RaiseBar.Maximum     = I.Money;
                RaiseBar.SmallChange = bb;
                RaiseBar.LargeChange = 5 * bb;
                ShowButtons();
                if (bet - inround > I.Money)
                {
                    Call.Text = "All In";
                    RaiseBar.Hide();
                    RaiseAmount.Hide();
                    Raise.Hide();
                }
                else if (tmp > I.Money)
                {
                    Raise.Text = "All In";
                    RaiseBar.Hide();
                    RaiseAmount.Hide();
                }
            }
            else if (command[0] == "Call") // Call$position$amount
            {
                int pos    = int.Parse(command[1]);
                int amount = int.Parse(command[2]);
                players[pos].Money -= amount;
                Pot.Text            = (int.Parse(Pot.Text) + amount) + "";
                Write(players[pos].Name + " calls and adds " + amount + "$ to the pot");
                players[pos].Action.Hide();
            }
            else if (command[0] == "Raise") // Raise$position$amount$total
            {
                int pos    = int.Parse(command[1]);
                int amount = int.Parse(command[2]);
                players[pos].Money -= amount;
                Pot.Text            = (int.Parse(Pot.Text) + amount) + "";
                Write(players[pos].Name + " raises to " + int.Parse(command[3]));
                players[pos].Action.Hide();
            }
            else if (command[0] == "Fold") // Fold$position$
            {
                int pos = int.Parse(command[1]);
                players[pos].Pocket0.Hide();
                players[pos].Pocket1.Hide();
                Write(players[pos].Name + " folds");
                players[pos].Action.Hide();
            }
            else if (command[0] == "Check") // Check$position$
            {
                Write(players[int.Parse(command[1])].Name + " checks");
                players[int.Parse(command[1])].Action.Hide();
            }
            else if (command[0] == "AllIn") // Allin$position$
            {
                int pos = int.Parse(command[1]);
                Write(players[pos].Name + " moves All-In");
                players[pos].Action.Hide();
                Pot.Text = (int.Parse(Pot.Text) + players[pos].Money) + "";
                players[int.Parse(command[1])].Money = 0;
            }

            else if (command[0] == "Kick") // Kick$
            {
                I.Write("Stand$");
                Stand.Hide();
                Sit.Show();
            }
        }