Example #1
0
 public AGT_SpriteId AddResource(string id, AGT_PointList pointlist)
 {
     return AddResource(id, pointlist.ToBitmap(_device_), pointlist.Location.X + Math.Abs(X), pointlist.Location.Y + Math.Abs(Y), 0);
 }
Example #2
0
 public void ClearWaypointGroupSelection()
 {
     lock (this)
     {
         _waypoint_group_selection = AGT_PointList.Empty;
     }
 }
Example #3
0
        public void AddWaypointGroup(string waypoint_group_id)
        {
            lock (this)
            {
                AGT_PointList az = new AGT_PointList(waypoint_group_id, FillModeType.None);
                az.ClosedShape = false;
                az.DrawJoints = true;
                Point[] points = _mouse_points.ToArray();
                for (int i = 0; i < points.Length; i++)
                {
                    points[i].X = (int)((float)points[i].X / PlayfieldScale);
                    points[i].Y = (int)((float)points[i].Y / PlayfieldScale);
                }

                az.AddLines(points);
                _waypoint_group_sprites.AddResource(waypoint_group_id, az);
                ChangeMode(PlayfieldModeType.Select);

                this._waypoint_group_stack.AddFirst(az);
            }
        }
Example #4
0
 public void ClearActiveZoneSelection()
 {
     lock (this)
     {
         _active_zone_selection = AGT_PointList.Empty;
     }
 }
Example #5
0
        public void AddActiveZone(string active_zone_id)
        {
            lock (this)
            {
                AGT_PointList az = new AGT_PointList(active_zone_id, FillModeType.Fill);
                az.ClosedShape = true;
                Point[] points = _mouse_points.ToArray();
                for (int i = 0; i < points.Length; i++ )
                {
                    points[i].X =(int)((float)points[i].X / PlayfieldScale);
                    points[i].Y = (int)((float)points[i].Y / PlayfieldScale);
                }
                az.AddLines(points);
                
                _active_zone_sprites.AddResource(active_zone_id, az);
                ChangeMode(PlayfieldModeType.Select);

                _active_zone_stack.AddFirst(az);
            }
        }
Example #6
0
        public AGT_PointList SelectWaypointGroupAt(int x, int y)
        {
            lock (this)
            {
                if (_waypoint_group_selection != null)
                {
                    SendActiveZoneToBack(_waypoint_group_selection.Id);
                    _waypoint_group_selection = AGT_PointList.Empty;
                }

                LinkedListNode<AGT_PointList> node = _waypoint_group_stack.Last;
                while (node != null)
                {
                    AGT_PointList p = (AGT_PointList)node.Value;

                    if (p.HitTest((int)((float)(x - _map_sprites.X) / PlayfieldScale), (int)((float)(y - _map_sprites.Y) / PlayfieldScale)))
                    {
                        lock (this)
                        {
                            _waypoint_group_selection = p;
                        }
                        BringActiveZoneToFront(p.Id);
                        return p;
                    }
                    node = node.Previous;
                }
                return AGT_PointList.Empty;
            }
        }