void OnTriggerEnter(Collider objC) { switch (ZoneType) { case ZoneType.DeathZone: if (objC.CompareTag("Sphere")) { objC.transform.parent.GetComponent<Sphere>().YouDeadBro(); } else if (string.Equals(objC.gameObject.name, "ZoneCollider")) { objC.transform.parent.gameObject.GetComponent<Box>().YouDeadBro(); ZoneType = ZoneType.Walkable; } break; case ZoneType.Walkable: break; default: throw new ArgumentOutOfRangeException(); } }
// Detect the relevant MapEntry on the cell // Information gathered here is used both for building the overlay legend and actually highlighting the objects public static void ProcessCell(int cell) { GameObject building = Grid.Objects[cell, (int)ObjectLayer.Building]; GameObject pickupable = Grid.Objects[cell, (int)ObjectLayer.Pickupables]; if (IsCurrentFilter(FilterGeysers) && building != null && IsGeyserRevealed(cell) && building.GetComponent <Geyser>() != null) { UpdateMapEntry(building, building.GetComponent <Geyser>().configuration.GetElement()); } else if (IsCurrentFilter(FilterGeysers) && building != null && IsGeyserRevealed(cell) && building.HasTag(GameTags.OilWell)) { UpdateMapEntry(building, SimHashes.CrudeOil); } else if (IsCurrentFilter(FilterBuildings) && building != null && BuildingList.Contains(building.name)) { UpdateMapEntry(building); } else if (IsCurrentFilter(FilterCritters) && pickupable != null && pickupable.HasTag(GameTags.Creature)) { UpdateMapEntry(pickupable); } else if (IsCurrentFilter(FilterPlants) && building != null && building.HasTag(GameTags.Plant)) { UpdateMapEntry(building); } else if (IsCurrentFilter(FilterBiomes)) { ZoneType biome = World.Instance.zoneRenderData.worldZoneTypes[cell]; UpdateMapEntry(biome.ToString(), GetName(biome), biome); } }
public CardMovedEvent(CardMovedEvent e) : base(e) { Player = e.Player; Card = e.Card; Source = e.Source; Destination = e.Destination; }
/// <summary> /// Add the specified name and zoneType. /// </summary> /// <param name='name'> /// Name. /// </param> /// <param name='zoneType'> /// Zone type. /// </param> public static void Add(string name, ZoneType zoneType) { lock (_syncObject) { switch (zoneType) { case ZoneType.RedUp: if (!_redUp.Contains(name)) _redUp.Add(name); break; case ZoneType.YellowUp: if (!_yellowUp.Contains(name)) _yellowUp.Add(name); break; case ZoneType.YellowDown: if (!_yellowDown.Contains(name)) _yellowDown.Add(name); break; case ZoneType.RedDown: if (!_redDown.Contains(name)) _redDown.Add(name); break; } } }
static void GenerateOutpostLayoutMainRoom() { ZoneType mainRoomType = OG_Common.GetRandomZoneTypeBigRoom(outpostData); Rot4 mainRoomRotation = Rot4.Random; zoneMap[mainRoomZoneOrd, mainRoomZoneAbs] = new ZoneProperties(mainRoomType, mainRoomRotation, Rot4.North); }
public SwapParameters(int cardPosition, ZoneType oldCardZone, int newCardPosition) { CardPosition = cardPosition; NewCardPosition = newCardPosition; OldCardZone = oldCardZone; }
void InitializeZones(ZoneType zoneType) { foreach (var zone in FiresecManager.Zones) { if (zone.ZoneType != zoneType) continue; var zoneViewModel = new ZoneViewModel(zone); if (InstructionZonesList.IsNotNullOrEmpty()) { var instructionZone = InstructionZonesList.FirstOrDefault(x => x == zoneViewModel.Zone.UID); if (instructionZone != Guid.Empty) InstructionZones.Add(zoneViewModel); else AvailableZones.Add(zoneViewModel); } else { AvailableZones.Add(zoneViewModel); } } if (InstructionZones.IsNotNullOrEmpty()) SelectedInstructionZone = InstructionZones[0]; if (AvailableZones.IsNotNullOrEmpty()) SelectedAvailableZone = AvailableZones[0]; }
public ActionResult ZoneTypeDestroy([DataSourceRequest] DataSourceRequest request, ZoneType zonetype) { BL.ZoneTypes blZoneTypes = new BL.ZoneTypes(); ZoneType model = blZoneTypes.SoftDelete(zonetype); return(Json(new[] { model }.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet)); }
public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response) { if (!((CommandSender)sender).CheckPermission("fctrl.killzone")) { response = "Access denied."; return(false); } if (arguments.Count() < 1) { response = "Invalid format. Must be: \"killzone light/heavy/entrance/surface (eg. killzone light)"; return(false); } if (arguments.At(0).ToLower() != "light" && arguments.At(0).ToLower() != "heavy" && arguments.At(0).ToLower() != "entrance" && arguments.At(0).ToLower() != "surface") { response = "First argument must be light, heavy, entrance, or surface"; return(false); } ZoneType zone = (arguments.At(0).ToLower() == "light" ? ZoneType.LightContainment : (arguments.At(0).ToLower() == "heavy" ? ZoneType.HeavyContainment : (arguments.At(0).ToLower() == "entrance" ? ZoneType.Entrance : (arguments.At(0).ToLower() == "surface" ? ZoneType.Surface : ZoneType.Unspecified)))); int totalKilled = 0; foreach (Player Ply in Player.List) { if (Ply.CurrentRoom.Zone == zone && !Ply.IsGodModeEnabled) { Ply.Hurt(99999, DamageTypes.Wall, "ZONEKILL"); totalKilled++; } } response = $"Killed {totalKilled} players in {zone.ToString()}"; return(true); }
/// <summary> /// List of zones for given user/sport /// </summary> /// <param name="userId">ASP.NET Identity Id</param> /// <param name="zone">Zone Type (Bike, Run, Swim - HeartRate/Pace/etc)</param> /// <returns>List of Zones</returns> public IEnumerable <Zone> GetUserZones(string userId, ZoneType zone) { return(_context.Zone .Where(z => z.UserId == userId && z.ZoneType == zone) .OrderBy(z => z.StartDate) .ToList()); }
/// <summary> /// Find a connection over a road from a startPos to a specified zone type. /// </summary> /// <param name="startPos">Start position of the attempt.</param> /// <param name="dest">Zone type to go to.</param> /// <returns>1 if connection found, 0 if not found, -1 if no connection to road found.</returns> short makeTraffic(Position startPos, ZoneType dest) { curMapStackPointer = 0; // Clear position stack var pos = new Position(startPos); #if false if ((!getRandom(2)) && findPerimeterTelecom(pos)) { /* printf("Telecom!\n"); */ return(1); } #endif if (findPerimeterRoad(pos)) { if (tryDrive(pos, dest)) { addToTrafficDensityMap(); return(1); } return(0); } else { return(-1); } }
public static Zone[][] Layout(LayoutSize size) { Zone[][] matrix = new Zone[size.Row][]; // Layout matrix. // For each matrix index create a random type zone. for (int i = 0; i < size.Row; i++) { matrix[i] = new Zone[size.Col]; for (int j = 0; j < size.Col; j++) { Location loc = new Location(i, j); ZoneType type = ZoneType(); matrix[i][j] = new Zone(type, loc); } } // Create 4 texi charge stations. matrix[size.Row / 3][size.Col / 3].Type = TexiService.ZoneType.TexiCharge; // NW matrix[size.Row / 3][2 * size.Col / 3].Type = TexiService.ZoneType.TexiCharge; // NE matrix[2 * size.Row / 3][size.Col / 3].Type = TexiService.ZoneType.TexiCharge; // SW matrix[2 * size.Row / 3][2 * size.Col / 3].Type = TexiService.ZoneType.TexiCharge; // SE return(matrix); }
public static ZoneType GetRandomZoneTypeSmallRoom(OG_OutpostData outpostData) { List <ZoneTypeWithWeight> smallRoomsList = new List <ZoneTypeWithWeight>(); if (outpostData.isMilitary) { smallRoomsList.Add(new ZoneTypeWithWeight(ZoneType.SmallRoomBarracks, 2f)); smallRoomsList.Add(new ZoneTypeWithWeight(ZoneType.SmallRoomMedibay, 1f)); smallRoomsList.Add(new ZoneTypeWithWeight(ZoneType.SmallRoomWeaponRoom, 5f)); smallRoomsList.Add(new ZoneTypeWithWeight(ZoneType.SecondaryEntrance, 6f)); smallRoomsList.Add(new ZoneTypeWithWeight(ZoneType.Empty, 1f)); } else { smallRoomsList.Add(new ZoneTypeWithWeight(ZoneType.SmallRoomBarracks, 4f)); smallRoomsList.Add(new ZoneTypeWithWeight(ZoneType.SmallRoomMedibay, 3f)); smallRoomsList.Add(new ZoneTypeWithWeight(ZoneType.SmallRoomWeaponRoom, 1f)); smallRoomsList.Add(new ZoneTypeWithWeight(ZoneType.SecondaryEntrance, 2f)); smallRoomsList.Add(new ZoneTypeWithWeight(ZoneType.Empty, 1f)); } ZoneType smallRoomType = GetRandomZoneTypeByWeight(smallRoomsList); return(smallRoomType); }
public static ZoneType GetRandomZoneTypeExteriorZone(OG_OutpostData outpostData) { List <ZoneTypeWithWeight> exteriorZonesList = new List <ZoneTypeWithWeight>(); if (outpostData.isMilitary) { exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.WaterPool, 5f)); exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.Cemetery, 4f)); exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.ExteriorRecRoom, 2f)); exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.ShootingRange, 7f)); exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.MortarBay, 5f)); exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.Empty, 2f)); } else { exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.WaterPool, 4f)); if ((Find.Map.Biome != BiomeDef.Named("ExtremeDesert")) && (Find.Map.Biome != BiomeDef.Named("IceSheet"))) { exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.Farm, 5f)); } exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.Cemetery, 3f)); exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.ExteriorRecRoom, 5f)); exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.ShootingRange, 1f)); exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.MortarBay, 1f)); exteriorZonesList.Add(new ZoneTypeWithWeight(ZoneType.Empty, 1f)); } ZoneType exteriorZoneType = GetRandomZoneTypeByWeight(exteriorZonesList); return(exteriorZoneType); }
public void Move() { if (Place < ZoneType.ATT) { Place = (ZoneType)((int)Place + 1); } }
public CardMovedEvent(Guid player, Guid card, ZoneType source, ZoneType destination) : base() { Player = player; Card = card; Source = source; Destination = destination; }
/// <summary> /// 有参构造函数(根据经度计算投影带的带号及中央子午线经度)。 /// </summary> /// <param name="longitude"></param> public ProjectionZone(double longitude, ZoneType zoneType) { if (zoneType == ZoneType.ThreeZone)//3°带 { if ((longitude - 1.5) % 3 != 0) { ZoneNumber = Math.Floor((longitude - 1.5) / 3) + 1; CentralMeridianLongitude = 3 * ZoneNumber; } else { ZoneNumber = Math.Floor((longitude - 1.5) / 3); CentralMeridianLongitude = 3 * ZoneNumber; } } if (zoneType == ZoneType.SixZone)//6°带 { if (longitude % 6 != 0) { ZoneNumber = Math.Floor(longitude / 6) + 1; CentralMeridianLongitude = 6 * ZoneNumber - 3; } else { ZoneNumber = Math.Floor(longitude / 6); CentralMeridianLongitude = 6 * ZoneNumber - 3; } } }
public HarvestZone(ZoneType zoneType, Type tool) { m_ZoneType = zoneType; m_Area = new ArrayList(); m_RequiredTool = tool; m_Map = Map.Felucca; }
public void WriteToStream(Stream stream, ZoneType zoneType) { stream.Write(ActorDefinition, StringCoding.ZeroTerminated); stream.Write(RenderDistance); stream.Write((uint)Instances.Count); foreach (Instance instance in Instances) { stream.Write(instance.Position); stream.Write(instance.Rotation); stream.Write(instance.Scale); stream.Write(instance.ID); stream.Write(instance.DontCastShadows); stream.Write(instance.LODMultiplier); if (zoneType != ZoneType.H1Z1) { continue; } stream.Write(instance.UnknownDword1); stream.Write(instance.UnknownDword2); stream.Write(instance.UnknownDword3); stream.Write(instance.UnknownDword4); stream.Write(instance.UnknownDword5); } }
public static Relic Build(ZoneType zone) { var ret = new Relic(zone); Counts[zone] += 1; return(ret); }
public static Object ReadFromStream(Stream stream, ZoneType zoneType) { Object obj = new Object(); obj.ActorDefinition = stream.ReadString(StringCoding.ZeroTerminated); obj.RenderDistance = stream.ReadSingle(); obj.Instances = new List <Instance>(); uint instancesLength = stream.ReadUInt32(); for (uint i = 0; i < instancesLength; i++) { Instance instance = new Instance(); instance.Position = stream.ReadVector4(); instance.Rotation = stream.ReadVector4(); instance.Scale = stream.ReadVector4(); instance.ID = stream.ReadUInt32(); instance.DontCastShadows = stream.ReadBoolean(); instance.LODMultiplier = stream.ReadSingle(); if (zoneType == ZoneType.H1Z1) { instance.UnknownDword1 = stream.ReadUInt32(); instance.UnknownDword2 = stream.ReadUInt32(); instance.UnknownDword3 = stream.ReadUInt32(); instance.UnknownDword4 = stream.ReadUInt32(); instance.UnknownDword5 = stream.ReadUInt32(); } obj.Instances.Add(instance); } return(obj); }
public static ZoneType GetRandomZoneTypeMediumRoom(OG_OutpostData outpostData) { List <ZoneTypeWithWeight> mediumRoomZonesList = new List <ZoneTypeWithWeight>(); if (outpostData.isMilitary) { mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomMedibay, 7f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomPrison, 5f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomKitchen, 3f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomWarehouse, 2f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomWeaponRoom, 7f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomBarn, 5f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomLaboratory, 2f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomRecRoom, 4f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.Empty, 1f)); } else { mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomMedibay, 3f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomPrison, 1f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomKitchen, 4f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomWarehouse, 5f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomWeaponRoom, 2f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomBarn, 2f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomLaboratory, 7f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.MediumRoomRecRoom, 7f)); mediumRoomZonesList.Add(new ZoneTypeWithWeight(ZoneType.Empty, 1f)); } ZoneType exteriorZoneType = GetRandomZoneTypeByWeight(mediumRoomZonesList); return(exteriorZoneType); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] ZoneType zoneType) { if (id != zoneType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(zoneType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ZoneTypeExists(zoneType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(zoneType)); }
/*******************************************************************/ public void MoveCard(Guid cardGuid, ZoneType zoneType) { CardView card = cardsManager.Get(cardGuid); ZoneView zone = zonesManager.GetZoneByType(zoneType); card.transform.SetParent(zone.transform, false); }
public void OnNotify(NotificationType type, Card card, ZoneType zone, Player player) { foreach (Player p in match.Players) { foreach (Card c in p.Zones.GetCardsInPlay()) { switch (type) { case NotificationType.EnterZone: c.OnCardEnter(zone, card, player); break; case NotificationType.ExitZone: c.OnCardExit(zone, card, player); break; case NotificationType.BeginTurn: c.OnBeginTurn(player); break; case NotificationType.EndTurn: c.OnEndTurn(player); for (int i = 0; i < Global.NumPlayers; i++) { if(!match.Players[i].Equals(player)) { match.Players[i].BeginTurn(); } } break; } } } }
//public int turn { get => turn; set => turn = value; } //public int tilePosition { get => tilePosition; set => tilePosition = value; } //public ZoneType zone { get => zone; set => zone = value; } //public string displayName { get => displayName; set => displayName = value; } public Player(string displayName, string punName) { this.displayName = displayName; this.punName = punName; this.tilePosition = 0; this.zone = ZoneType.StarterZone; }
public Zone GetZone(ZoneType zone) { switch (zone) { case ZoneType.BattleZone: return(BattleZone); case ZoneType.Deck: return(Deck); case ZoneType.Graveyard: return(Graveyard); case ZoneType.Hand: return(Hand); case ZoneType.ManaZone: return(ManaZone); case ZoneType.ShieldZone: return(ShieldZone); case ZoneType.SpellStack: case ZoneType.Anywhere: default: throw new InvalidOperationException(); } }
public bool Execute(ArraySegment <string> arguments, ICommandSender sender, out string response) { if (!((CommandSender)sender).CheckPermission("fctrl.zones")) { response = "Access denied."; return(false); } if (arguments.Count() < 1) { response = "Invalid format. Must be: \"blackoutzone light/heavy/entrance\" (eg. closezone light)"; return(false); } if (arguments.At(0).ToLower() != "light" && arguments.At(0).ToLower() != "heavy" && arguments.At(0).ToLower() != "entrance") { response = "First argument must be light, heavy, or entrance"; return(false); } ZoneType zone = (arguments.At(0).ToLower() == "light" ? ZoneType.LightContainment : (arguments.At(0).ToLower() == "heavy" ? ZoneType.HeavyContainment : (arguments.At(0).ToLower() == "entrance" ? ZoneType.Entrance : ZoneType.Unspecified))); foreach (Room r in Map.Rooms) { if (r.Zone == zone) { foreach (Door d in r.Doors) { d.SetStateWithSound(false); } } } response = $"Successfully closed all the doors in {zone.ToString()}"; return(true); }
private static void TriggerZoneLightsOut(ZoneType zone) { List <Room> rooms = null; switch (zone) { case ZoneType.Entrance: rooms = ent; break; case ZoneType.HeavyContainment: rooms = hcz; break; case ZoneType.LightContainment: rooms = lcz; break; } if (rooms == null) { return; } var randomDuration = Random.Range(Config.MinDurationOfFlicker, Config.MaxDurationOfFlicker); var contSize = rooms.Count; for (int i = 0; i < contSize; i++) { rooms[i].TurnOffLights(randomDuration); } }
/// <summary> /// Get a zone value (eg FTP, Pace, Heart Rate) on a given date. /// </summary> /// <param name="userId">ASP.NET Identity Id</param> /// <param name="zone">Required Zone Type</param> /// <param name="activityDate">Activity Date</param> /// <returns></returns> public int?GetUserZoneValueOnGivenDate(string userId, ZoneType zone, DateTime activityDate) { // remove time portion. activityDate = activityDate.Date; // get all values for the user/zone. var allValues = _repo.GetUserZones(userId, zone).ToList(); if (allValues.Count == 0) { return(null); } // file to before the activity date. var list = allValues .OrderByDescending(z => z.StartDate) .Where(z => z.StartDate <= activityDate) .ToList(); if (list.Count == 0) { return(null); } // return the first before the activity date. return(list .Select(z => z.Value) .FirstOrDefault()); }
/// <summary> /// Write the zone information. Since we always write exactly one zone, /// only the <paramref name="numberOfPoints"/> and the /// <paramref name="numberOfElements"/> differ between the /// reconstructed and the continuous case. /// </summary> /// <param name="time"> /// <see cref="PlotDriver.PlotFields(string, string, double, IEnumerable{DGField})"/> ///</param> /// <param name="zoneType"><see cref="Tecplot.TecplotZone.ZoneType"/></param> /// <param name="numberOfPoints"> /// The total number of vertices in the plot /// </param> /// <param name="numberOfElements"> /// The total number of cells in the plot /// </param> /// <param name="zone_name"> /// arbitrary naming for the zone /// </param> private void WriteZoneInformation(double time, ZoneType zoneType, int numberOfPoints, int numberOfElements, string zone_name) { IntPtr ptrZoneTitle = Marshal.StringToHGlobalAnsi(zone_name); int zoneTypeIndex = (int)zoneType; int KMax = 0, ICellMax = 0, JCellMax = 0, KCellMax = 0, NFConn = 0, FNMode = 0; int IsBlock = 1; int StrandID = 0, ParentZone = 0, ShrConn = 0; teczne110(ptrZoneTitle, ref zoneTypeIndex, ref numberOfPoints, ref numberOfElements, ref KMax, ref ICellMax, ref JCellMax, ref KCellMax, ref time, ref StrandID, ref ParentZone, ref IsBlock, ref NFConn, ref FNMode, null, // No passive variables null, // All variables node-centered null, // No shared variables ref ShrConn); Marshal.FreeHGlobal(ptrZoneTitle); }
private static string getZoneHintMessage(ZoneType zone, bool justUnlocked) { if (zone == ZoneType.Void) { return($"no hint for Void(area {InterOp.get_player_area()})"); } var items = HintObjects.GetOrElse(zone, new List <Checkable>()); var found = items.FindAll(i => i.Has()); if (!justUnlocked && !HaveHintForZone(zone)) { return($"{zone}: {found.Count}/?? key items (Hint not unlocked)"); } if (items.Count > 0) { var g = found.Count == items.Count ? "$" : ""; if (found.Count > 0) { return($"{zone}: {g}{found.Count}/{items.Count}{g} key items\nfound: {String.Join(", ", found.Select(i => i.DisplayName))}"); } else { return($"{zone}: {found.Count}/{items.Count} key items"); } } return($"No key items in {zone}"); }
public static void ProgressWithHints(ZoneType _zone = ZoneType.Void, bool justUnlocked = false) { int duration = justUnlocked ? 300 : 240; if (SeedController.HintsDisabled || InterOp.get_game_state() != GameState.Game) { if (!justUnlocked) { AHK.SendPlainText(new PlainText(SeedController.Progress, duration), justUnlocked); } return; } var zone = _zone == ZoneType.Void ? CurrentZone : _zone; var msg = getZoneHintMessage(zone, justUnlocked); if (justUnlocked) { msg = $"Bought hint: {msg}"; } else { msg = $"{SeedController.Progress}\n{msg}{GetKeySkillHints()}"; } AHK.SendPlainText(new PlainText(msg, duration), justUnlocked); }
public ZoneOfArrow(int indexOfStartPoint, int indexOfEndPoint, Axis axis, ZoneType zoneType) { IndexOfStartPoint = indexOfStartPoint; IndexOfEndPoint = indexOfEndPoint; Axis = axis; ZoneType = zoneType; }
public override void OnEnter(ZoneType zone) { base.OnEnter(zone); if(zone == ZoneType.Play) { SpellEffect(); } }
public ZoneSpecificVisitorInformationReportUI() { InitializeComponent(); LoadAllZone(); zoneName = (ZoneType)zoneTypeComboBox.SelectedItem; LoadZoneTypeVisitor(zoneName); totalTextBox.Text = Convert.ToString(visitorDetails.Count); }
public List<int> ZoneTypeVisitor(ZoneType zone) { List<int>visitorIDList =new List<int>(); visitorIDList = relation.GetVisitorID(zone); return visitorIDList; }
public override void OnCardEnter(ZoneType zone, Card card, Player player) { base.OnCardEnter(zone, card, player); if(zone == ZoneType.Play && card is Creature) { ((Creature)card).Wake(); } }
/// <summary> /// Default Constructor /// </summary> /// <param name="id"></param> /// <param name="files"></param> /// <param name="type"></param> /// <param name="wrapper"></param> public ZoneRenderer(int id, IEnumerable<FileInfo> files, ZoneType type, ClientDataWrapper wrapper) : base(id, files, type) { TreeReplacement = wrapper.TreeReplacement; NifCache = new Dictionary<int, ClientMesh>(); InstancesMatrix = new KeyValuePair<int, Matrix>[0]; ClientWrapper = wrapper; }
internal Zone(Player owner, int id, ZoneType type, ZoneVisibility visibility) { Owner = owner; Id = id; Type = type; Visibility = visibility; CardInstances = type != ZoneType.Library ? new List<CardInstance>() : null; CardModels = type == ZoneType.Library ? new List<ICardModel>() : null; }
public CityRenderer(int id, IEnumerable<FileInfo> files, ZoneType type, ClientDataWrapper wrapper) : base(id, files, type, wrapper) { var nifs = CityNifs; AddNifCache(nifs); Matrix scaleMatrix; ZoneDrawingExtensions.CreateScale(UnitFactor, UnitFactor, UnitFactor, out scaleMatrix); Matrix rotated; ZoneDrawingExtensions.Mult(ref scaleMatrix, ref RotationMatrix, out rotated); InstancesMatrix = nifs.Select(n => new KeyValuePair<int, Matrix>(n.Key, rotated)).ToArray(); }
/// <summary> /// Initializes a new instance of the <see cref="PlayerActionDivineIntervention.ModifyZoneType"/> struct. /// </summary> /// <param name='zoneType'> /// Zone type. /// </param> public ModifyZoneType(ZoneType zoneType) : this() { this.zoning_code = 2; // AP (None); switch (zoneType) { case ZoneType.Protected: this.zoning_code = 16; // REC break; case ZoneType.Residential: this.zoning_code = 12; // R-1 break; } }
public string Save(ZoneType aZoneType) { if (zoneTypeGateway.Save(aZoneType) > 0) { return " Successfully Save !"; } else { return "Save Failed !"; } }
protected override ZoneType[] SetZoneTypes(Cell[] cells, ILandSettings settings) { var zones = new ZoneType[cells.Length]; var zoneTypes = settings.ZoneTypes.Select(z => z.Type).ToArray(); for (var i = 0; i < zones.Length; i++) { var zoneType = zoneTypes[Random.Range(0, zoneTypes.Length)]; zones[i] = zoneType; } return zones; }
public Land(LandLayout layout, ILandSettings settings) { _settings = settings; _zones = layout.Zones.Select(z => new Zone(z)).ToArray(); Layout = layout; _idwCoeff = settings.IDWCoeff; _idwOffset = settings.IDWOffset; _zoneMaxType = settings.ZoneTypes.Max(z => z.Type); _zoneTypesCount = _zones.Where(z => z.Type != ZoneType.Empty).Distinct(Zone.TypeComparer).Count(); _zoneSettings = settings.ZoneTypes.ToArray(); _chunksBounds = new Bounds2i(settings.LandBounds.Min/(settings.BlocksCount*settings.BlockSize), settings.LandBounds.Max/(settings.BlocksCount*settings.BlockSize)); }
protected ZoneGenerator(ZoneLayout zone, [NotNull] LandLayout land, [NotNull] ILandSettings landSettings) { if (land == null) throw new ArgumentNullException("land"); if (landSettings == null) throw new ArgumentNullException("landSettings"); _zone = zone; Land = land; _landSettings = landSettings; _blocksCount = landSettings.BlocksCount; _blockSize = landSettings.BlockSize; _chunkSize = _blocksCount*_blockSize; _zoneMaxType = landSettings.ZoneTypes.Max(z => z.Type); DefaultBlock = landSettings.ZoneTypes.First(z => z.Type == zone.Type).DefaultBlock; }
public void LoadZoneTypeVisitor(ZoneType zoneName) { visitorDetails= new List<Visitor>(); visitorIdList = zoneManager.ZoneTypeVisitor(zoneName); foreach (int id in visitorIdList) { Visitor aVisitor=new Visitor(); aVisitor = visitorManager.GetVisitorInfo(id); visitorDetails.Add(aVisitor); } LoadDataGridView(visitorDetails); }
public List<int> GetVisitorID(ZoneType zone) { List<int>visitorIDList =new List<int>(); dbGateway.SqlCommandObj.CommandText = "SELECT * FROM Relation_tbl WHERE ZoneTypeID='"+zone.ID+"'"; dbGateway.SqlConnectionObj.Open(); SqlDataReader reader = dbGateway.SqlCommandObj.ExecuteReader(); int id = 0; while (reader.Read()) { id = int.Parse(reader["VisitorID"].ToString()); visitorIDList.Add(id); } reader.Close(); dbGateway.SqlConnectionObj.Close(); return visitorIDList; }
public InstructionZonesViewModel(List<Guid> instructionZonesList, ZoneType zoneType) { AddOneCommand = new RelayCommand(OnAddOne, CanAddOne); RemoveOneCommand = new RelayCommand(OnRemoveOne, CanRemoveOne); AddAllCommand = new RelayCommand(OnAddAll, CanAddAll); RemoveAllCommand = new RelayCommand(OnRemoveAll, CanRemoveAll); Title = "Выбор зоны"; InstructionZonesList = new List<Guid>(instructionZonesList); InstructionZones = new ObservableCollection<ZoneViewModel>(); AvailableZones = new ObservableCollection<ZoneViewModel>(); InitializeZones(zoneType); if (InstructionZones.IsNotNullOrEmpty()) SelectedInstructionZone = InstructionZones[0]; }
protected override ZoneType[] SetZoneTypes(Cell[] cells, ILandSettings settings) { var zoneTypes = settings.ZoneTypes.Select(z => z.Type).ToArray(); var zones = new ZoneType[cells.Length]; //Calculate zone types for (var i = 0; i < zones.Length; i++) { if (zones[i] == ZoneType.Empty) { //Start cluster var zoneType = zoneTypes[Random.Range(0, zoneTypes.Length)]; var clusterSize = Random.Range(2, 5); var zoneIndexes = GetFreeNeighborsDepthFirst(cells, zones, i, clusterSize); foreach (var zoneIndex in zoneIndexes) zones[zoneIndex] = zoneType; } } return zones; }
internal static char Zone2Char(ZoneType zone) { return ZoneChar[(int)zone]; }
public ZoneDetailsViewModel(ZoneType zoneType) :this(null) { ComboboxIsEnabled = false; ZoneType = zoneType; }
/// <summary> /// Displays the controls contents. /// </summary> protected override void DisplayControlsContents() { ResourceTileSelection selection = ResourceTileSelection.GetCurrent(); bool areButtonsDisabled = isActionInProgress || selection.Count() == 0; m_scrollPosition = GUILayout.BeginScrollView(m_scrollPosition); { GUILayout.Label("Zone Type:", m_mainText); m_zoneType = (ZoneType)GUILayout.SelectionGrid( (int)m_zoneType, System.Enum.GetNames(typeof(ZoneType)), m_selectionGridCount, m_styles.smallButton ); if (GUILayout.Button(new GUIContent("Set Zone Type", dialogConfirmButtonDo.tooltip), areButtonsDisabled?m_buttonDisabled:m_button)) { m_tileModifications.resource_tile = m_zoningModification; StartCoroutine(Put(selection)); } m_styles.DrawLine(GUIStyles.LineDirection.Horizontal, GUIStyles.LineColor.Medium); GUILayout.Label("Housing:", m_mainText); GUILayout.BeginHorizontal(); { GUILayout.Label(string.Format("Capacity: {0}", m_housingCapacity), m_minorText); int capacity = (int)GUILayout.HorizontalSlider( (float)m_housingCapacity, (float)m_possibleHousingCapacityValues[0], (float)m_possibleHousingCapacityValues[m_possibleHousingCapacityValues.Count-1] ); for (int i=1; i<m_possibleHousingCapacityValues.Count; ++i) { if (capacity >= m_possibleHousingCapacityValues[i-1] && capacity < m_possibleHousingCapacityValues[i] ) { capacity = m_possibleHousingCapacityValues[i-1]; } } m_housingCapacity = capacity; } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { GUILayout.Label(string.Format("Occupants: {0}", m_housingOccupants), m_minorText); m_housingOccupants = (int)GUILayout.HorizontalSlider( m_housingOccupants, 0, m_housingCapacity ); m_housingOccupants = Mathf.Clamp(m_housingOccupants, 0, m_housingCapacity); } GUILayout.EndHorizontal(); if (GUILayout.Button(new GUIContent("Set Housing", dialogConfirmButtonDo.tooltip), areButtonsDisabled?m_buttonDisabled:m_button)) { m_tileModifications.resource_tile = m_housingModifications; StartCoroutine(Put(selection)); } m_styles.DrawLine(GUIStyles.LineDirection.Horizontal, GUIStyles.LineColor.Medium); GUILayout.Label("Base Cover Type:", m_mainText); m_baseCoverType = (BaseCoverType)GUILayout.SelectionGrid( (int)m_baseCoverType, System.Enum.GetNames(typeof(BaseCoverType)), m_selectionGridCount, m_styles.smallButton ); if (GUILayout.Button(new GUIContent("Set Base Cover Type", dialogConfirmButtonDo.tooltip), areButtonsDisabled?m_buttonDisabled:m_button)) { m_tileModifications.resource_tile = m_baseCoverModification; StartCoroutine(Put(selection)); } m_styles.DrawLine(GUIStyles.LineDirection.Horizontal, GUIStyles.LineColor.Medium); GUILayout.Label("Trees:", m_mainText); float max = 100f; GUILayout.BeginHorizontal(); { for (int i=0; i<m_treeDistribution.Length; ++i) { GUILayout.BeginVertical(); { GUILayout.Label(m_treeDistribution[i].ToString(), m_minorText); m_treeDistribution[i] = (int)(max-GUILayout.VerticalSlider(max-(float)m_treeDistribution[i], 0f, max, GUILayout.Height(40f))); GUILayout.Label(string.Format("{0}\"", (i+1)*2), m_minorText); } GUILayout.EndVertical(); } } GUILayout.EndHorizontal(); if (GUILayout.Button(new GUIContent("Set Trees", dialogConfirmButtonDo.tooltip), areButtonsDisabled?m_buttonDisabled:m_button)) { m_tileModifications.resource_tile = m_treeModifications; StartCoroutine(Put(selection)); } GUILayout.BeginHorizontal(); { m_isHarvestArea = GUILayout.Toggle(m_isHarvestArea, string.Format("Harvest Area: {0}", m_isHarvestArea), m_button); if (GUILayout.Button(new GUIContent("Set Harvest Area", dialogConfirmButtonDo.tooltip), areButtonsDisabled?m_buttonDisabled:m_button)) { m_tileModifications.resource_tile = m_harvestAreaModifications; StartCoroutine(Put(selection)); } } GUILayout.EndHorizontal(); // TODO: supported saplings // GUILayout.Label("Aminals:", m_mainText); } GUILayout.EndScrollView(); m_styles.DrawLine(GUIStyles.LineDirection.Horizontal, GUIStyles.LineColor.Medium); DisplayPaintSelectionControlGroup(); }
private void showButton_Click(object sender, EventArgs e) { zoneName = (ZoneType)zoneTypeComboBox.SelectedItem; LoadZoneTypeVisitor(zoneName); totalTextBox.Text = Convert.ToString(visitorDetails.Count); }
public MemoryZone(ZoneType zone, UInt64 startAddress, UInt64 endAddress) { _zone = zone; _startAddress = startAddress; _endAddress = endAddress; }
public MemoryZone(ZoneType zone, string zoneSpecification) { string[] addresses = zoneSpecification.Split(new Char[]{':'}, 2); if(addresses.Length != 2) throw new ArgumentException(string.Format("Invalid zone specification '{0}'", zoneSpecification)); _startAddress = StringHelper.StringToUInt64(addresses[0]); _endAddress = StringHelper.StringToUInt64(addresses[1]); _zone = zone; }
public static bool IsZoneMediumRoom(ZoneType zoneType) { return ((zoneType == ZoneType.MediumRoomMedibay) || (zoneType == ZoneType.MediumRoomPrison) || (zoneType == ZoneType.MediumRoomKitchen) || (zoneType == ZoneType.MediumRoomWarehouse) || (zoneType == ZoneType.MediumRoomWeaponRoom) || (zoneType == ZoneType.MediumRoomBarn) || (zoneType == ZoneType.MediumRoomLaboratory) || (zoneType == ZoneType.MediumRoomRecRoom)); }
private static string GetZoneCode(ZoneType zone) { string value = "0"; switch (zone) { default: case ZoneType.Green: value = "0"; break; case ZoneType.RedUp: value = "+2"; break; case ZoneType.YellowUp: value = "+1"; break; case ZoneType.YellowDown: value = "-1"; break; case ZoneType.RedDown: value = "-2"; break; } return value; }
/// <summary> /// Default Construtor Intialize Values with Sector.Dat /// </summary> /// <param name="id"></param> /// <param name="files"></param> /// <param name="type"></param> public ZoneGeometry(int id, IEnumerable<FileInfo> files, ZoneType type) { if (files == null) throw new ArgumentNullException("files"); // Assign ID ID = id; // Copy Files Array m_files = files.ToArray(); // Assign Zone Type ZoneType = type; // Parse Sector.dat IDictionary<string, IDictionary<string, string>> sectorDat; try { sectorDat = m_files.GetFileDataFromPackage(DatPackage, SectorFile).ReadDATFile(); } catch (Exception e) { // Terrains can't be drawn without Scale and Offset if (ZoneType == ZoneType.Terrain) throw new ArgumentException(string.Format("No usable sector.dat Found when building Zone ID: {0}", id), "files", e); sectorDat = new Dictionary<string, IDictionary<string, string>>(); } // Read Terrain IDictionary<string, string> terrain; if (sectorDat.TryGetValue("terrain", out terrain)) { string scalefactor; string offsetfactor; TerrainScale = terrain.TryGetValue("scalefactor", out scalefactor) ? short.Parse(scalefactor) : (short)-1; TerrainOffset = terrain.TryGetValue("offsetfactor", out offsetfactor) ? short.Parse(offsetfactor) : (short)-1; } else { TerrainScale = -1; TerrainOffset = -1; } // Read Sector Size IDictionary<string, string> sectorsize; if (sectorDat.TryGetValue("sectorsize", out sectorsize)) { string sizex; string sizey; SizeX = sectorsize.TryGetValue("sizex", out sizex) ? short.Parse(sizex) : (short)-1; SizeY = sectorsize.TryGetValue("sizey", out sizey) ? short.Parse(sizey) : (short)-1; } else { SizeX = -1; SizeY = -1; } // Read Water Definitions IDictionary<string, string> waterdefs; if (sectorDat.TryGetValue("waterdefs", out waterdefs)) { string num; var rivers = new List<RiverGeometry>(); if (waterdefs.TryGetValue("num", out num)) { var numWater = short.Parse(num); for (int w = 0 ; w < numWater ; w++) { IDictionary<string, string> river; if (sectorDat.TryGetValue(string.Format("river{0}", w.ToString("00")), out river)) { string texture; string multitexture; string flow; string height; string bankpoints; string color; string extend_posx; string extend_posy; string extend_negx; string extend_negy; string tesselation; string name; string rtype; short r_flow = river.TryGetValue("flow", out flow) ? short.Parse(flow) : (short)0; int r_height = river.TryGetValue("height", out height) ? int.Parse(height) : -1; short r_bankpoints = river.TryGetValue("bankpoints", out bankpoints) ? short.Parse(bankpoints) : (short)0; int r_color = river.TryGetValue("color", out color) ? int.Parse(color) : 0; int r_extend_posx = river.TryGetValue("extend_posx", out extend_posx) ? int.Parse(extend_posx) : 0; int r_extend_posy = river.TryGetValue("extend_posy", out extend_posy) ? int.Parse(extend_posy) : 0; int r_extend_negx = river.TryGetValue("extend_negx", out extend_negx) ? int.Parse(extend_negx) : 0; int r_extend_negy = river.TryGetValue("extend_negy", out extend_negy) ? int.Parse(extend_negy) : 0; short r_tesselation = river.TryGetValue("tesselation", out tesselation) ? short.Parse(tesselation) : (short)0; river.TryGetValue("texture", out texture); river.TryGetValue("multitexture", out multitexture); river.TryGetValue("name", out name); river.TryGetValue("type", out rtype); var banks = new List<Tuple<IEnumerable<short>, IEnumerable<short>>>(); for (int b = 0 ; b < r_bankpoints ; b++) { string left; string right; if (!river.TryGetValue(string.Format("left{0}", b.ToString("00")), out left)) continue; if (!river.TryGetValue(string.Format("right{0}", b.ToString("00")), out right)) continue; banks.Add(new Tuple<IEnumerable<short>, IEnumerable<short>>(left.Split(',').Select(s => short.Parse(s)), right.Split(',').Select(s => short.Parse(s)))); } var riverGeo = new RiverGeometry(w, name, rtype, texture, multitexture, r_flow, r_height, r_color, r_extend_posx, r_extend_posy, r_extend_negx, r_extend_negy, r_tesselation, banks); rivers.Add(riverGeo); } } } Rivers = rivers.ToArray(); } else { Rivers = new RiverGeometry[0]; } }
public ZoneSettings this[ZoneType index] { get { return _zoneSettingsLookup[(int)index]; } }