Exemplo n.º 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;
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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];
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }