示例#1
0
        public Summoner(DatabaseReader reader)
        {
            Id = reader.Integer();

            Region = (RegionType)reader.Integer();

            AccountId = reader.Integer();
            SummonerId = reader.Integer();

            SummonerName = reader.String();
            InternalName = reader.String();

            SummonerLevel = reader.Integer();
            ProfileIcon = reader.Integer();

            HasBeenUpdated = reader.Boolean();

            UpdateAutomatically = reader.Boolean();

            TimeCreated = reader.Integer();
            TimeUpdated = reader.Integer();

            LastUpdateTrial = reader.Integer();

            RevisionDate = reader.Integer();

            reader.SanityCheck(Fields);
        }
示例#2
0
    public static GameObject GetRegionAreaCover( RegionType region )
    {
        if( instance )
            return instance.internalGetRegionAreaCover( region );

        return null;
    }
示例#3
0
 public void AddSummonerToCache(RegionType region, Summoner summoner)
 {
     lock (SummonerCache)
     {
         SummonerCache[summoner.Region][summoner.AccountId] = summoner;
     }
 }
    public void RegionExited(int zone, RegionType regionType)
    {
        if (regionType == RegionType.Highlight)
            floorMechController.StopHighlighting();

        lastExit [zone, (int)regionType] = Time.time;
    }
示例#5
0
        public Summoner(DbDataReader dataReader)
        {
            Reader reader = new Reader(dataReader);

            Id = reader.Integer();

            Region = reader.String().ToRegionType();

            AccountId = reader.Integer();
            SummonerId = reader.Integer();

            SummonerName = reader.String();
            InternalName = reader.String();

            SummonerLevel = reader.Integer();
            ProfileIcon = reader.Integer();

            UpdateAutomatically = reader.Boolean();

            TimeCreated = reader.Time();
            TimeUpdated = reader.Time();

            reader.SanityCheck(Fields);

            Ratings = new List<SummonerRating>();
            RatingDictionary = new Dictionary<MapType, Dictionary<GameModeType, SummonerRating>>();
            RankedStatistics = new List<SummonerRankedStatistics>();
        }
示例#6
0
        public ContentTypeTag([NotNull] IContentType contentType, RegionType regionType)
        {
            Requires.NotNull(contentType, nameof(contentType));
            Requires.Argument(regionType == RegionType.Begin || regionType == RegionType.End, nameof(regionType), $"Unexpected region type: {regionType}");

            _contentType = contentType;
            _regionType  = regionType;
        }
示例#7
0
 public Cell(RegionType parent_region)
 {
     this.region_type = parent_region;
     cell_status      = CellStatus.EMPTY;
     type_build       = TypeBuild.NONE;
     cur_progress     = 0.0f;
     max_progress     = 100.0f;
 }
示例#8
0
        public ActionResult DeleteConfirmed(short id)
        {
            RegionType regiontype = db.RegionTypes.Find(id);

            db.RegionTypes.Remove(regiontype);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#9
0
 private RegionType GetRegionType(Boolean refresh)
 {
     if (_regionType.IsNull() || refresh)
     {
         _regionType = new RegionType(1, "RegionTypeName", new DataContext(GetUserContext()));
     }
     return(_regionType);
 }
示例#10
0
        public static bool GetWindowRegion(IntPtr hWnd, out Region region)
        {
            IntPtr     hRgn      = GDI.CreateRectRgn(0, 0, 0, 0);
            RegionType windowRgn = (RegionType)GetWindowRgn(hWnd, hRgn);

            region = Region.FromHrgn(hRgn);
            return((windowRgn != RegionType.ERROR) && (windowRgn != RegionType.NULLREGION));
        }
示例#11
0
 public static UrbanIssue CreateIssue(RegionType region)
 {
     return(new UrbanIssue
     {
         Id = ++issueId,
         Region = region
     });
 }
示例#12
0
        public ContentTypeTag(IContentType contentType, RegionType regionType)
        {
            Contract.Requires <ArgumentNullException>(contentType != null, "contentType");
            Contract.Requires <ArgumentException>(regionType == RegionType.Begin || regionType == RegionType.End);

            _contentType = contentType;
            _regionType  = regionType;
        }
示例#13
0
 public DieMobRegion(Region _reg)
 {
     TSRegion           = _reg;
     Type               = RegionType.Kill;
     ReplaceMobs        = new Dictionary <int, int>();
     AffectFriendlyNPCs = false;
     AffectStatueSpawns = false;
 }
示例#14
0
        private City GetCity()
        {
            RegionType regionType = ScopeService.Init().RegionCollection.Find(m => m.RegionId == this.RegionId);

            this.CityId     = regionType.CityId;
            this.RegionName = regionType.RegionName;
            return(new City(regionType.CityId));
        }
        public static bool GetWindowRegion(IntPtr hWnd, out Region region)
        {
            IntPtr     hRgn       = CreateRectRgn(0, 0, 0, 0);
            RegionType regionType = (RegionType)GetWindowRgn(hWnd, hRgn);

            region = Region.FromHrgn(hRgn);
            return(regionType != RegionType.ERROR && regionType != RegionType.NULLREGION);
        }
        public ContentTypeTag(IContentType contentType, RegionType regionType)
        {
            Contract.Requires<ArgumentNullException>(contentType != null, "contentType");
            Contract.Requires<ArgumentException>(regionType == RegionType.Begin || regionType == RegionType.End);

            _contentType = contentType;
            _regionType = regionType;
        }
示例#17
0
 public static WaterRegion GetRegion(this Thing thing, RegionType allowedRegiontypes = RegionType.Set_Passable)
 {
     if (!thing.Spawned)
     {
         return(null);
     }
     return(!thing.Spawned ? null : WaterRegionAndRoomQuery.RegionAt(thing.Position, thing.Map, allowedRegiontypes));
 }
示例#18
0
 public SpawnOptions(RegionType type)
 {
     this.type           = type;
     this.enableSpawning = false;
     this.amount         = new Range(0, 1);
     this.width          = new Range(0, 1);
     this.length         = new Range(0, 1);
 }
示例#19
0
        public static RegionType SelectClipRgn(HandleRef hdc, HandleRef hrgn)
        {
            RegionType result = SelectClipRgn(hdc.Handle, hrgn.Handle);

            GC.KeepAlive(hdc.Wrapper);
            GC.KeepAlive(hrgn.Wrapper);
            return(result);
        }
 public static VehicleRegion GetRegion(this Thing thing, RegionType allowedRegiontypes = RegionType.Set_Passable)
 {
     if (!thing.Spawned)
     {
         return(null);
     }
     return(!thing.Spawned ? null : RegionAt(thing.Position, thing.Map, allowedRegiontypes));
 }
示例#21
0
 /// <summary>
 /// If the billGiver is our SimpleAssembler, get the room of the output tile.
 /// Else, retain origin behavior.
 /// </summary>
 /// <param name="pawn"></param>
 /// <param name="allowedRegionTypes"></param>
 /// <param name="billGiver"></param>
 /// <returns></returns>
 public static Room GetRoomOfPawnOrGiver(Pawn pawn, RegionType allowedRegionTypes, IBillGiver billGiver)
 {
     if (pawn.kindDef == PRFDefOf.PRFSlavePawn && billGiver is Building_SimpleAssembler assembler)
     {
         return(RegionAndRoomQuery.RoomAt(assembler.OutputComp.CurrentCell, billGiver.Map, RegionType.Set_Passable));
     }
     return(pawn.GetRoom(allowedRegionTypes));
 }
 public static Room GetRoom(this Thing thing, RegionType allowedRegionTypes = RegionType.Set_Passable)
 {
     if (!thing.Spawned)
     {
         return(null);
     }
     return(RegionAndRoomQuery.RoomAt(thing.Position, thing.Map, allowedRegionTypes));
 }
示例#23
0
 public List <Summoner> GetAutomaticUpdateSummoners(RegionType region)
 {
     lock (SummonerCache)
     {
         var regionCache = SummonerCache[region];
         return((from x in regionCache.Values where x.UpdateAutomatically == true select x).ToList());
     }
 }
		public static Region GetRegion(this Thing thing, RegionType allowedRegionTypes = RegionType.Set_Passable)
		{
			if (!thing.Spawned)
			{
				return null;
			}
			return RegionAndRoomQuery.RegionAt(thing.Position, thing.Map, allowedRegionTypes);
		}
示例#25
0
        public void Update(
            string name, string description, RegionType type)
        {
            Name        = name;
            Description = description;
            Type        = type;

            LastModified = DateTime.UtcNow;
        }
        public static RegionType CombineRgn(HandleRef hRgn, HandleRef hRgn1, HandleRef hRgn2, CombineMode nCombineMode)
        {
            RegionType result = CombineRgn(hRgn.Handle, hRgn1.Handle, hRgn2.Handle, nCombineMode);

            GC.KeepAlive(hRgn.Wrapper);
            GC.KeepAlive(hRgn1.Wrapper);
            GC.KeepAlive(hRgn2.Wrapper);
            return(result);
        }
示例#27
0
		Region CreateOnceClickRegion(RegionType regionType) {
			RegionMeta meta = new RegionMeta();
			meta.type = regionType;

			var region = regionCreater.Create(meta, this);
			region.transform.parent = transform;

			return region;
		}
		public static Room RoomAtFast(IntVec3 c, Map map, RegionType allowedRegionTypes = RegionType.Set_Passable)
		{
			Region validRegionAt = map.regionGrid.GetValidRegionAt(c);
			if (validRegionAt != null && (validRegionAt.type & allowedRegionTypes) != 0)
			{
				return validRegionAt.Room;
			}
			return null;
		}
示例#29
0
 public Country(string shortName, string code2A, string code3A, string longName, string capital, RegionType region)
 {
     this.ShortName = shortName;
     this.Code2A    = code2A;
     this.Code3A    = code3A;
     this.LongName  = longName;
     this.Capital   = capital;
     this.Region    = region;
 }
示例#30
0
        public static IList <Person> SearchPersonsByRegionType(RegionType regionType)
        {
            if (regionType == null)
            {
                throw new ArgumentNullException("regionType");
            }

            return(Provider.GetPersonsByRegionType(regionType));
        }
示例#31
0
        public override int GetHashCode()
        {
            int hashCode = 138455800;

            hashCode = hashCode * -1521134295 + base.GetHashCode();
            hashCode = hashCode * -1521134295 + Name.GetHashCode();
            hashCode = hashCode * -1521134295 + RegionType.GetHashCode();
            return(hashCode * -1521134295 + Depth.GetHashCode());
        }
示例#32
0
 public RegionEntry(RegionType type, Path path, RegionClipType clipType)
 {
     regionType = type;
     regionPath = new Paths()
     {
         path
     };
     regionClipType = clipType;
 }
示例#33
0
        public void Execute(IRocketPlayer caller, string[] command)
        {
            if (command.Length < 2)
            {
                this.SendUsage(caller);
                return;
            }

            var name     = command.GetStringParameter(0);
            var typeName = command.GetStringParameter(1).ToLower();

            if (RegionsPlugin.Instance.GetRegion(name, true) != null)
            {
                UnturnedChat.Say(caller, "A region with this name already exists!", Color.red);
                return;
            }

            var type = RegionType.RegisterRegionType(typeName);

            if (type == null)
            {
                var types = "";
                for (int i = 0; i < RegionType.GetTypes().Count; i++)
                {
                    var t = RegionType.GetTypes()[i];
                    if (types == "")
                    {
                        types = t;
                        continue;
                    }

                    types += ", " + t;
                }
                UnturnedChat.Say(caller, "Unknown type: " + typeName + "! Available types: " + types, Color.red);
                return;
            }
            var args = new ArrayList(command);

            args.RemoveAt(0); // remove name...
            args.RemoveAt(0); // remove type...
            var region = type.OnCreate(caller, name, (string[])args.ToArray(typeof(string)));

            if (region == null)
            {
                UnturnedChat.Say(caller, "Could't create region!", Color.red);
                return;
            }

            RegionsPlugin.Instance.Regions.Add(region);
            RegionsPlugin.Instance.OnRegionCreated(region);

            region.SetFlag("EnterMessage", "Entered region: {0}", new List <GroupValue>());
            region.SetFlag("LeaveMessage", "Left region: {0}", new List <GroupValue>());

            RegionsPlugin.Instance.Configuration.Save();
            UnturnedChat.Say(caller, "Successfully created region: " + name, Color.green);
        }
示例#34
0
 public void Clear(RegionType regionType)
 {
     _currentValues &= ~(regionType switch
     {
         RegionType.Row => _rowMask,
         RegionType.Column => _colMask,
         RegionType.Box => _boxMask,
         _ => 0
     });
        public static RegionType CombineRgn(HandleRef hrgnDst, HandleRef hrgnSrc1, HandleRef hrgnSrc2, CombineMode iMode)
        {
            RegionType result = CombineRgn(hrgnDst.Handle, hrgnSrc1.Handle, hrgnSrc2.Handle, iMode);

            GC.KeepAlive(hrgnDst.Wrapper);
            GC.KeepAlive(hrgnSrc1.Wrapper);
            GC.KeepAlive(hrgnSrc2.Wrapper);
            return(result);
        }
示例#36
0
 public Region(int idx, int len, RegionType type, string matchID, string groupID, string captureID)
 {
     Index     = idx;
     Length    = len;
     Type      = type;
     MatchID   = matchID;
     GroupID   = groupID;
     CaptureID = captureID;
 }
示例#37
0
 public Summoner GetSummoner(RegionType region, int accountId)
 {
     lock (SummonerCache)
     {
         Summoner output = null;
         SummonerCache[region].TryGetValue(accountId, out output);
         return(output);
     }
 }
示例#38
0
        public ActionResult Create(RegionType regiontype)
        {
            if (ModelState.IsValid)
            {
                db.RegionTypes.Add(regiontype);
                db.SaveChanges();

                return RedirectToAction("Index");
            }

            return View(regiontype);
        }
示例#39
0
 public static void EliminateDuplicates(SudokuModel model, int col, int row, RegionType foundInType, int foundInI)
 {
     if (model.IsSolved(col, row)) {
         var value = model.GetValue(col, row);
         foreach (var region in model.GetIntersectingRegions(col, row)) {
             if (foundInType != region.Type || foundInI != region.I) {
                 foreach (var other in model.GetCells(region.Type, region.I)) {
                     if (other.Column != col || other.Row != row) {
                         model.Eliminate(other.Column, other.Row, value);
                     }
                 }
             }
         }
     }
 }
示例#40
0
        public void LoadBootSnap(CICKeyType cic, RegionType region)
        {
            List<GprRegWrite> regs = new List<GprRegWrite>();
            List<Mem32Write> mem32 = new List<Mem32Write>();
            BinaryWriter bw = new BinaryWriter(Machine.Current.N64MemorySafe);

            StreamReader reader = new StreamReader(m_BootSnapStream);
            XDocument doc = XDocument.Load(reader, LoadOptions.None);
            XElement root = doc.Root;

            var results = GetSnapElements(root, cic, region);

            foreach (var result in results)
            {
                if (result.Name == "GPRRegSet")
                {
                    regs.Add(
                        new GprRegWrite
                        {
                            index = Int32.Parse(result.Attribute("Index").Value),
                            value = UInt64.Parse(HexFix(result.Value), NumberStyles.AllowHexSpecifier)
                        });
                }

                if (result.Name == "Mem32")
                {
                    mem32.Add(
                        new Mem32Write
                        {
                            index = Int32.Parse(result.Attribute("Index").Value),
                            position = Int64.Parse(HexFix(result.Attribute("Offset").Value), NumberStyles.AllowHexSpecifier),
                            value = UInt32.Parse(HexFix(result.Value), NumberStyles.AllowHexSpecifier),
                        });
                }
            }

            /* Now we do the actual writes to the emulator */
            foreach (var reg in regs)
            {
                Machine.Current.DeviceCPU.State.WriteGPRUnsigned(reg.index, reg.value);
            }

            foreach (var m in mem32)
            {
                bw.BaseStream.Position = m.position + (4 * m.index);
                bw.Write(m.value);
            }
        }
    public void RegionEntered(int zone, RegionType regionType)
    {
        if (regionType == RegionType.Activate) {
            if ((Time.time - lastChangeTime) > slowZoneChangeTime) {
                ConfirmEntry (zone);
            } else {
                StartCoroutine (SlowChangeZone (zone));
            }
        } else if (floorMechController.zonesController.activeZone != zone) {
            floorMechController.HighlightZone (zone);
        }

        lastEntry [zone, (int)regionType] = Time.time;
        lastChangeZone = zone;
        lastChangeRegion = regionType;
    }
示例#42
0
		public static Base Create(string name, Location location, RegionType region)
		{
			return new Base
			{
				Name = name,
				Number = GameState.Current.Data.NextBaseNumber++,
				Location = location,
				Region = region,
				Facilities = new List<Facility>(),
				Crafts = new List<Craft>(),
				Soldiers = new List<Soldier>(),
				Stores = Stores.Create(),
				ResearchProjects = new List<ResearchProject>(),
				ManufactureProjects = new List<ManufactureProject>(),
				TransferredSoldiers = new List<TransferItem<Soldier>>(),
				TransferredCrafts = new List<TransferItem<Craft>>(),
				TransferredStores = new List<TransferItem<StoreItem>>()
			};
		}
 private void UpdateRegion(int id, double area, string message, CollegeInfo info, RegionType type)
 {
     CollegeRegion region = _repository.GetRegion(id);
     if (region == null)
     {
         info.CollegeRegion = new CollegeRegion
         {
             Area = area,
             Info = message,
             RegionType = type
         };
     }
     else
     {
         region.Area = area;
         region.Info = message;
         region.RegionType = type;
     }
 }
示例#44
0
 public void Update(Spell spell)
 {
     switch (spell.target[2])
     {
         case 'H':
             type = RegionType.Row;
             break;
         case 'C':
             type = RegionType.Column;
             break;
         case 'R':
             type = RegionType.Circle;
             break;
         case 'B':
             type = RegionType.Rect;
             break;
         case 'G':
             type = RegionType.Grid;
             break;
         default:
             type = RegionType.None;
             break;
     }
     length = spell.length;
     switch (spell.target[1])
     {
         case 'E':
             color = Color.Red;
             break;
         case 'F':
             color = Color.Green;
             break;
         case 'A':
             color = Color.Yellow;
             break;
         default:
             color = Color.White;
             break;
     }
 }
示例#45
0
        public Region(RegionType type, Dictionary<Type, Type> points = null)
        {
            ID = Guid.NewGuid();

            switch (type)
            {
                case RegionType.InfoLayer:
                    { rType = RegionType.InfoLayer; break; }
                case RegionType.Layer:
                    { rType = RegionType.Layer; break; }
                case RegionType.Mask:
                    { rType = RegionType.Mask; break; }
            }

            if ( points !=null )
            {
                Points = points;
            }

            InitializeRegion(this);

        }
示例#46
0
 public List<Summoner> GetAutomaticUpdateSummoners(RegionType region)
 {
     lock (SummonerCache)
     {
         var regionCache = SummonerCache[region];
         return (from x in regionCache.Values where x.UpdateAutomatically == true select x).ToList();
     }
 }
示例#47
0
 public Summoner GetSummoner(RegionType region, string name)
 {
     //This is bad because the name search could be performed much faster, but as this code was already modified a lot to be specialised for a much smaller database it probably won't have much of an impact right now
     lock (SummonerCache)
     {
         string target = name.ToLower();
         foreach (var summoner in SummonerCache[region].Values)
         {
             if (target == summoner.SummonerName.ToLower())
                 return summoner;
         }
         return null;
     }
 }
示例#48
0
        /// <summary>
        /// Region growing to encode the source image data.
        /// </summary>
        /// <param name="locationPool"></param>
        /// <param name="maximumDistance"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private static HashSet<Region> Process(LocationPool locationPool, double maximumDistance, RegionType type)
        {
            HashSet<Region> result = new HashSet<Region>();
            List<Location> todoList = new List<Location>();
            //let's process pixels into regions
            Region region = null;

            HashSet<Location> alreadyChecked = new HashSet<Location>();

            while (!locationPool.Empty())
            {
                alreadyChecked.Clear();
                Location seed = locationPool.RandomLocation();
                //Console.WriteLine("Have seed " + seed);
                if (type == RegionType.MonoRegion)
                {
                    region = new MonoRegion();
                }
                else if (type == RegionType.MultiColorRegion)
                {
                    MultiColorRegion multiColorRegion = new MultiColorRegion(maximumDistance);
                    region = multiColorRegion;
                }

                region.Add(seed);
                region.Origin = seed.Point;
                seed.Region = region;
                locationPool.SetMarked(seed);
                alreadyChecked.Add(seed);

                AddNeighbors(seed, todoList, alreadyChecked);
                todoList.Sort((x, y) => (int)(SxzColor.GetColorDistance(seed.Color, x.Color) - SxzColor.GetColorDistance(seed.Color, y.Color)));

                int sortCounter = 0;

                //inner loop
                while (todoList.Count != 0)
                {
                    //Console.WriteLine("Unmarked total " + locationPool.Unmarked.Count + " and todolist total " + todoList.Count);
                    seed = todoList[0];
                    todoList.RemoveAt(0);
                    sortCounter++;

                    if (seed.Marked)
                    {
                        throw new Exception("Location already marked!");
                    }

                    if (!region.IsValid(seed))
                    {
                        //we can process non-adjacent pixels by adding neighbors here and sorting before returning but limit the distance from an already
                        //validated location
                        continue;
                    }

                    //Console.WriteLine("Parsed pixel " + seed);
                    //we have a winner!
                    region.Add(seed);
                    locationPool.SetMarked(seed);

                    AddNeighbors(seed, todoList, alreadyChecked);
                    //if (todoList.Count < 1000)
                    if (todoList.Count < 1000 || sortCounter > 1000)
                    {
                        //let's limit the number to be sorted for performance sake
                        todoList.Sort((x1, y1) => (int)(SxzColor.GetColorDistance(seed.Color, x1.Color) - SxzColor.GetColorDistance(seed.Color, y1.Color)));
                        sortCounter = 0;
                    }
                }

                result.Add(region);
            }

            return result;
        }
示例#49
0
 public Summoner GetSummoner(RegionType region, int accountId)
 {
     lock (SummonerCache)
     {
         Summoner output = null;
         SummonerCache[region].TryGetValue(accountId, out output);
         return output;
     }
 }
 public RegionEntry(RegionType type)
     : this(type, null, new Paths(), RegionClipType.None)
 {
 }
示例#51
0
 public void Set(string name, RegionType region)
 {
     Set(name, (int)region);
 }
示例#52
0
 public Summoner(AllPublicSummonerDataDTO publicSummoner, RegionType summonerRegion)
 {
     Initialise(publicSummoner, summonerRegion);
 }
 public RegionEntry(RegionType type, object obj)
     : this(type, obj, new Paths(), RegionClipType.None)
 {
 }
 public RegionEntry(RegionType type, object obj, Path path)
     : this(type, obj, path, RegionClipType.None)
 {
 }
示例#55
0
 public Summoner(PublicSummoner publicSummoner, RegionType summonerRegion)
 {
     Initialise(publicSummoner, summonerRegion);
 }
示例#56
0
        public void Initialise(AllPublicSummonerDataDTO publicSummoner, RegionType summonerRegion)
        {
            //Id cannot be set yet

            Region = summonerRegion;

            var summoner = publicSummoner.summoner;

            AccountId = summoner.acctId;
            SummonerId = summoner.sumId;

            SummonerName = summoner.name;
            InternalName = summoner.internalName;

            SummonerLevel = publicSummoner.summonerLevel.summonerLevel;
            ProfileIcon = summoner.profileIconId;

            HasBeenUpdated = false;

            UpdateAutomatically = false;

            int time = (int)Time.UnixTime();

            TimeCreated = time;
            TimeUpdated = time;

            RevisionDate = 0;
            LastUpdateTrial = 0;
        }
示例#57
0
 public static Region Create(RegionType type, int index)
 {
     return new Region(type, index);
 }
示例#58
0
 public Region(RegionType type, int index)
 {
     Type = type;
     Index = index;
 }
 public RegionEntry(RegionType type, object obj, Paths path, RegionClipType clipType)
 {
     regionType = type;
     regionObject = obj;
     regionPath = path;
     regionClipType = clipType;
 }
 //:
 //this (type, obj, new Paths<List<IntPoint>>(path), clipType)
 public RegionEntry(RegionType type, object obj, Path path, RegionClipType clipType)
 {
     regionType = type;
     regionObject = obj;
     regionPath = new Paths() { path };
     regionClipType = clipType;
 }