Пример #1
0
        public override Entity loadConfig(ConfuseSection sect)
        {
            LightEntity ent = new LightEntity();
            ent.Type = types[0];

            ent.X = sect.get_int("x", 0);
            ent.Y = sect.get_int("y", 0);

            return ent;
        }
Пример #2
0
        public override Entity loadConfig(ConfuseSection sect)
        {
            LightEntity ent = new LightEntity();

            ent.Type = types[0];

            ent.X = sect.get_int("x", 0);
            ent.Y = sect.get_int("y", 0);

            return(ent);
        }
Пример #3
0
        private void do_paint(Graphics g)
        {
            Brush br_darkgray = new SolidBrush(Color.FromArgb(20, 20, 20));

            // Background img
            if (this.dropdownBGtype.SelectedIndex == 0 && map.Terrain != null)
            {
                g.DrawImage(map.Terrain, 0, 0, map.Width * this.zoom, map.Height * this.zoom);
            }
            else if (this.dropdownBGtype.SelectedIndex == 1 && map.Terrain != null)
            {
                g.DrawImage(map.Heightmap, 0, 0, map.Width * this.zoom, map.Height * this.zoom);
            }

            // Zones
            foreach (Entity ent in map.Entities)
            {
                if (!(ent is ZoneEntity))
                {
                    continue;
                }

                ZoneEntity entc = (ZoneEntity)ent;

                g.DrawRectangle((ent == currEntity ? Pens.Red : Pens.White), entc.X * this.zoom - entc.Width * this.zoom / 2, entc.Y * this.zoom - entc.Height * this.zoom / 2, entc.Width * this.zoom, entc.Height * this.zoom);
            }

            // Lights
            foreach (Entity ent in map.Entities)
            {
                if (!(ent is LightEntity))
                {
                    continue;
                }

                LightEntity entc = (LightEntity)ent;

                g.DrawEllipse((ent == currEntity ? Pens.Red : Pens.White), entc.X * this.zoom, entc.Y * this.zoom, 10, 10);
            }

            // Objects
            foreach (Entity ent in map.Entities)
            {
                if (!(ent is ObjectEntity))
                {
                    continue;
                }

                ObjectEntity entc = (ObjectEntity)ent;

                g.DrawRectangle((ent == currEntity ? Pens.Red : Pens.White), entc.X * this.zoom - 5, entc.Y * this.zoom - 5, 10, 10);
            }
        }
Пример #4
0
        public override string saveConfig(Entity ent)
        {
            string      o = "";
            LightEntity z = (LightEntity)ent;

            o += "light {";
            o += "  x = " + z.X;
            o += "  y = " + z.Y;
            o += "}";

            return(o);
        }