Exemple #1
0
 public void ToggleCheat()
 {
     state++;
     if ((int)state == 3)
     {
         state = AutoMapState.None;
     }
 }
Exemple #2
0
        public AutoMap(World world)
        {
            this.world = world;

            this.minX = Fixed.MaxValue;
            this.maxX = Fixed.MinValue;
            this.minY = Fixed.MaxValue;
            this.maxY = Fixed.MinValue;

            foreach (var vertex in world.Map.Vertices)
            {
                if (vertex.X < this.minX)
                {
                    this.minX = vertex.X;
                }

                if (vertex.X > this.maxX)
                {
                    this.maxX = vertex.X;
                }

                if (vertex.Y < this.minY)
                {
                    this.minY = vertex.Y;
                }

                if (vertex.Y > this.maxY)
                {
                    this.maxY = vertex.Y;
                }
            }

            this.viewX = this.minX + (this.maxX - this.minX) / 2;
            this.viewY = this.minY + (this.maxY - this.minY) / 2;

            this.visible = false;
            this.state   = AutoMapState.None;

            this.zoom   = Fixed.One;
            this.follow = true;

            this.zoomIn  = false;
            this.zoomOut = false;
            this.left    = false;
            this.right   = false;
            this.up      = false;
            this.down    = false;

            this.marks          = new List <Vertex>();
            this.nextMarkNumber = 0;
        }
Exemple #3
0
        public AutoMap(World world)
        {
            this.world = world;

            minX = Fixed.MaxValue;
            maxX = Fixed.MinValue;
            minY = Fixed.MaxValue;
            maxY = Fixed.MinValue;
            foreach (var vertex in world.Map.Vertices)
            {
                if (vertex.X < minX)
                {
                    minX = vertex.X;
                }

                if (vertex.X > maxX)
                {
                    maxX = vertex.X;
                }

                if (vertex.Y < minY)
                {
                    minY = vertex.Y;
                }

                if (vertex.Y > maxY)
                {
                    maxY = vertex.Y;
                }
            }

            viewX = minX + (maxX - minX) / 2;
            viewY = minY + (maxY - minY) / 2;

            visible = false;
            state   = AutoMapState.None;

            zoom   = Fixed.One;
            follow = true;

            zoomIn  = false;
            zoomOut = false;
            left    = false;
            right   = false;
            up      = false;
            down    = false;

            marks          = new List <Vertex>();
            nextMarkNumber = 0;
        }