Пример #1
0
 public HexSelector(SectorMap.Milieu map, ResourceManager resourceManager, Location location, int jump)
 {
     this.map             = map ?? throw new ArgumentNullException(nameof(map));
     this.resourceManager = resourceManager ?? throw new ArgumentNullException(nameof(resourceManager));
     this.location        = location;
     if (jump < 0 || jump > 36)
     {
         throw new ArgumentOutOfRangeException(nameof(jump), jump, "must be between 0 and 36 inclusive");
     }
     this.jump = jump;
 }
Пример #2
0
        public void Resolve(SectorMap.Milieu sectorMap, out Sector sector, out Subsector subsector)
        {
            if (sectorMap == null)
            {
                throw new ArgumentNullException("sectorMap");
            }

            sector    = null;
            subsector = null;

            sector = sectorMap.FromLocation(SectorLocation.X, SectorLocation.Y);
            if (sector != null)
            {
                subsector = sector.Subsector(Index);
            }
        }
Пример #3
0
        public RectSelector(SectorMap.Milieu map, ResourceManager resourceManager, RectangleF rect, bool slop = true)
        {
            if (map == null)
            {
                throw new ArgumentNullException("map");
            }

            if (resourceManager == null)
            {
                throw new ArgumentNullException("resourceManager");
            }

            this.map             = map;
            this.resourceManager = resourceManager;
            this.rect            = rect;

            Slop       = slop;
            SlopFactor = 0.25f;
        }
Пример #4
0
        public HexSelector(SectorMap.Milieu map, ResourceManager resourceManager, Location location, int jump)
        {
            if (map == null)
            {
                throw new ArgumentNullException("map");
            }

            if (resourceManager == null)
            {
                throw new ArgumentNullException("resourceManager");
            }

            if (jump < 0 || jump > 36)
            {
                throw new ArgumentOutOfRangeException("jump", jump, "jump must be between 0 and 36 inclusive");
            }

            this.map             = map;
            this.resourceManager = resourceManager;
            this.location        = location;
            this.jump            = jump;
        }
Пример #5
0
        public void Resolve(SectorMap.Milieu sectorMap, ResourceManager resourceManager, out Sector sector, out World world)
        {
            if (sectorMap == null)
            {
                throw new ArgumentNullException("sectorMap");
            }

            sector = null;
            world  = null;

            sector = sectorMap.FromLocation(Sector.X, Sector.Y);
            if (sector == null)
            {
                return;
            }

            WorldCollection worlds = sector.GetWorlds(resourceManager, cacheResults: true);

            if (worlds != null)
            {
                world = worlds[Hex];
            }
        }
Пример #6
0
        public HexSelector(SectorMap.Milieu map, ResourceManager resourceManager, Location location, int jump)
        {
            if (map == null)
                throw new ArgumentNullException("map");

            if (resourceManager == null)
                throw new ArgumentNullException("resourceManager");

            if (jump < 0 || jump > 36)
                throw new ArgumentOutOfRangeException("jump", jump, "jump must be between 0 and 36 inclusive");

            this.map = map;
            this.resourceManager = resourceManager;
            this.location = location;
            this.jump = jump;
        }
Пример #7
0
        public RectSelector(SectorMap.Milieu map, ResourceManager resourceManager, RectangleF rect)
        {
            if (map == null)
                throw new ArgumentNullException("map");

            if (resourceManager == null)
                throw new ArgumentNullException("resourceManager");

            this.map = map;
            this.resourceManager = resourceManager;
            this.rect = rect;
        }
Пример #8
0
        public RectSelector(SectorMap.Milieu map, ResourceManager resourceManager, RectangleF rect, bool slop = true)
        {
            if (map == null)
                throw new ArgumentNullException("map");

            if (resourceManager == null)
                throw new ArgumentNullException("resourceManager");

            this.map = map;
            this.resourceManager = resourceManager;
            this.rect = rect;

            Slop = slop;
            SlopFactor = 0.25f;
        }