Example #1
0
        public void setDragonPanel(Dragon d)
        {
            Thread x = new Thread(new ThreadStart(thread_startd));

            x.IsBackground = true;
            x.Start();

            if (picBoxListDragon.ContainsKey(d.getId()))
            {
            }
            else
            {
                picBoxListDragon.Add(d.getId(), new PictureBox()
                {
                    BackColor     = System.Drawing.Color.Transparent,
                    Location      = new System.Drawing.Point(0, 0),
                    Name          = "dragonBox",
                    Size          = new System.Drawing.Size(24, 24),
                    TabIndex      = 4,
                    TabStop       = false,
                    ImageLocation = "draqgon2.gif",
                    SizeMode      = PictureBoxSizeMode.Zoom
                });
            }

            Did = d.getId();

            /*
             * picBoxListDragon = new List<PictureBox>();
             * tempDragonBox = new PictureBox()
             * {
             *  BackColor = System.Drawing.Color.Transparent,
             *  Location = new System.Drawing.Point(0, 0),
             *  Name = "dragonBox" + d.getX() + d.getY(),
             *  Size = new System.Drawing.Size(24, 24),
             *  TabIndex = 4,
             *  TabStop = false,
             *  ImageLocation = "draqgon2.gif"
             * };*/
            xmap = d.getX();
            ymap = d.getY();
            tempDragonBox.SizeMode = PictureBoxSizeMode.Zoom;
            //picBoxListDragon.Add(tempDragonBox);
        }
Example #2
0
        public Update(Dictionary <String, String> upd, EntityManager entmanager, Map map, GuiV1 gui)
        {
            if (upd.ContainsKey("type"))
            {
                if (upd["type"].Equals("Dragon"))
                {
                    this.id   = int.Parse(upd["id"]);
                    this.x    = int.Parse(upd["x"]);
                    this.y    = int.Parse(upd["y"]);
                    this.type = upd["type"];
                    this.busy = bool.Parse(upd["busy"]);
                    this.desc = upd["desc"];

                    Dragon d = new Dragon(this.id);
                    entmanager.addDragon(d);

                    entmanager.getDragon(this.id).setX(this.x);
                    entmanager.getDragon(this.id).setY(this.y);
                    entmanager.getDragon(this.id).setType(this.type);
                    entmanager.getDragon(this.id).setBusy(this.busy);
                    entmanager.getDragon(this.id).setdesc(this.desc);
                    entmanager.getDragon(this.id).toString();

                    g = gui;
                    g.setDragonPanel(entmanager.getDragon(this.id));
                    //entmanager.getDragon(this.id).toString();
                }

                if (upd["type"].Equals("Player"))
                {
                    this.id     = int.Parse(upd["id"]);
                    this.x      = int.Parse(upd["x"]);
                    this.y      = int.Parse(upd["y"]);
                    this.points = int.Parse(upd["points"]);
                    this.type   = upd["type"];
                    this.busy   = bool.Parse(upd["busy"]);
                    this.desc   = upd["desc"];

                    Player p = new Player(this.id);
                    entmanager.addPlayer(p);

                    entmanager.getPlayer(this.id).setX(this.x);
                    entmanager.getPlayer(this.id).setY(this.y);
                    entmanager.getPlayer(this.id).setPoints(this.points);
                    entmanager.getPlayer(this.id).setType(this.type);
                    entmanager.getPlayer(this.id).setBusy(this.busy);
                    entmanager.getPlayer(this.id).setdesc(this.desc);
                    Console.WriteLine("??????????????????????????????????????????????????");

                    g = gui;
                    g.setPlayerPanel(entmanager.getPlayer(this.id));
                    entmanager.getPlayer(this.id).toString();
                }
            }

            else if (upd.ContainsKey("row") && upd.ContainsKey("col"))
            {
                this.row  = int.Parse(upd["row"]);
                this.col  = int.Parse(upd["col"]);
                this.prop = upd["properties"];

                map.getMapcell(this.row, this.col).setProperties(prop);
                map.getMapcell(this.row, this.col).toString();
            }

            else
            {
                Console.WriteLine("Update-fehler");
            }
        }