public GatheringLocation(string name, LocationType locationType, ItemType gatheredItemType, ItemType requiredItemType) : base(name, locationType) { this.GatheredType = gatheredItemType; this.RequiredItem = requiredItemType; }
// get the default location, given type of location public static string DefaultLocation(LocationType locationType) { string directory; switch(locationType) { case LocationType.UserLocal: // Example: @"C:\Documents and Settings\<user>\Local Settings\Application Data\NASA\NASA World Wind\1.3.3.11250" return Application.LocalUserAppDataPath; case LocationType.UserCommon: // Example: @"C:\Documents and Settings\All Users\Application Data\NASA\NASA World Wind\1.3.3.11250" return Application.CommonAppDataPath; case LocationType.Application: // Example: @"C:\Program Files\NASA\World Wind\" return Application.StartupPath; default: // fall through to regular (roaming) user case LocationType.User: // Example: @"C:\Documents and Settings\<user>\Application Data\NASA\World Wind\1.3.3" directory = Log.DefaultSettingsDirectory(); Directory.CreateDirectory(directory); return directory; } }
public Location(string name, LocationType type=LocationType.TOWN) { Name = name; Type = type; entityTable.rdsCount = 3; }
public StorageAccount( string serviceName, string description, string locationOrAffinityGroup, LocationType locationType, StorageAccountGeoReplication geoReplication) : this() { Contract.Requires(!string.IsNullOrWhiteSpace(serviceName)); Contract.Requires(!string.IsNullOrWhiteSpace(description)); Contract.Requires(!string.IsNullOrWhiteSpace(locationOrAffinityGroup)); ServiceName = Label = serviceName; Description = description; if (locationType == LocationType.Region) { Location = locationOrAffinityGroup; } else { AffinityGroup = locationOrAffinityGroup; } GeoReplicationEnabled = geoReplication != StorageAccountGeoReplication.Disabled; SecondaryReadEnabled = geoReplication == StorageAccountGeoReplication.ReadAccessEnabled; ExtendedProperties = new Dictionary<string, string>(); Endpoints = new List<Uri>(); SecondaryEndpoints = new List<Uri>(); }
/// <summary> /// /// </summary> /// <param name="location"></param> /// <returns></returns> public static int DepthAtLocation(LocationType location) { if (location == LocationType.Exterior) return 0; return location == LocationType.Interior ? 1 : NULL; }
/// <summary> /// /// </summary> /// <param name="lineList"></param> /// <param name="leftLoc"></param> /// <param name="rightLoc"></param> private void AddCurves(IEnumerable lineList, LocationType leftLoc, LocationType rightLoc) { for (IEnumerator i = lineList.GetEnumerator(); i.MoveNext(); ) { AddCurve(i.Current as IList<Coordinate>, leftLoc, rightLoc); } }
public StorageAccount( string serviceName, string description, string locationOrAffinityGroup, LocationType locationType, StorageAccountType storageAccountType) : this() { Contract.Requires(!string.IsNullOrWhiteSpace(serviceName)); Contract.Requires(!string.IsNullOrWhiteSpace(description)); Contract.Requires(!string.IsNullOrWhiteSpace(locationOrAffinityGroup)); ServiceName = Label = serviceName; Description = description; if (locationType == LocationType.Region) { Location = locationOrAffinityGroup; } else { AffinityGroup = locationOrAffinityGroup; } AccountType = storageAccountType.ToString(); ExtendedProperties = new Dictionary<string, string>(); Endpoints = new List<Uri>(); SecondaryEndpoints = new List<Uri>(); }
internal ExpressionBreakpoint(DebuggerSession session, ThreadGroup group, LocationType type, string expression) : base(EventType.Breakpoint, expression, group) { this.Session = session; this.LocationType = type; }
/// <summary> /// Constructs a TopologyLocation specifying how points on, to the left of, and to the /// right of some GraphComponent relate to some Geometry. Possible values for the /// parameters are Location.Null, Location.Exterior, Location.Boundary, /// and Location.Interior. /// </summary> /// <param name="on"></param> /// <param name="left"></param> /// <param name="right"></param> public TopologyLocation(LocationType on, LocationType left, LocationType right) { Init(3); _location[(int)PositionType.On] = on; _location[(int)PositionType.Left] = left; _location[(int)PositionType.Right] = right; }
public static Sprite getBackgroundSprite (LocationType locationType) { switch (locationType) { case LocationType.ENCHANTED_FOREST: return enchantedForest; case LocationType.PLAINS: return plains; case LocationType.TWILIGHT_VALLEY: return twilightValley; default: Debug.Log("Unknown Location type"); return null; } }
public void returns_expected_result_when_argument_is_valid(string value, LocationType expectedResult) { var parser = BuildParser(); var result = parser.ParseProperty(value); Assert.AreEqual(expectedResult, result); }
private void fillEnemyTypes (LocationType locationType) { enemyTypes.Clear(); foreach (EnemyType type in Enum.GetValues(typeof(EnemyType))) { if (type.getLocationType() == locationType) { enemyTypes.Add(type); } } }
public Location(LocationType type, int id, int lat, int lon, string place, string name) { this.Type = type; this.Id = id; this.Lat = lat; this.Lon = lon; this.Place = place; this.Name = name; }
public Location(LocationType type, int id) { this.Type = type; this.Id = id; this.Lat = 0; this.Lon = 0; this.Place = null; this.Name = null; }
public Location(LocationType type, int lat, int lon) { this.Type = type; this.Id = 0; this.Lat = lat; this.Lon = lon; this.Place = null; this.Name = null; }
public Location(string name, string type) : base(name) { foreach (var locType in (LocationType[])Enum.GetValues(typeof(LocationType))) { if (locType.ToString() == type) { this.LocationType = locType; } } }
public Location(LocationType type, int id, string place, string name) { this.Type = type; this.Id = id; this.Lat = 0; this.Lon = 0; this.Place = place; this.Name = name; if (type != LocationType.ADDRESS) return; //this.GeocodeAddress(); }
public static int AddLocation(Guid organizationId, int deptID, string name, LocationType typeID) { Locations loc = new Locations(organizationId); loc.AddNew(); loc.DId = deptID; loc.Name = name; loc.LocationTypeId = (int)typeID; loc.Inactive = false; loc.IsDefault = false; loc.Save(); return loc.Id; }
private static Geometry MakeGeometry(LocationType locationType, double locationLat, double locationLong, double swLat, double swLong, double neLat, double neLong) { return new Geometry() { LocationType = locationType , Location = new LatLng(locationLat, locationLong) , Viewport = new Viewport( southWest: new LatLng(swLat, swLong) , northEast: new LatLng(neLat, neLong) ) }; }
private void OKbutton_Click(object sender, EventArgs e) { _server = serverTextBox.Text; if (dbNameRadioButton.Checked) { _locationType = LocationType.Name; _location = dbNameTextBox.Text; } else if (dbPathRadioButton.Checked) { _locationType = LocationType.Path; _location = dbPathTextBox.Text; } }
/// <summary> /// Converts the location value to a location symbol, for example, <c>EXTERIOR => 'e'</c>. /// </summary> /// <param name="locationValue"></param> /// <returns>Either 'e', 'b', 'i' or '-'.</returns> public static char ToLocationSymbol(LocationType locationValue) { switch (locationValue) { case LocationType.Exterior: return 'e'; case LocationType.Boundary: return 'b'; case LocationType.Interior: return 'i'; case LocationType.Null: return '-'; } throw new ArgumentException("Unknown location value: " + locationValue); }
public Location(string name, string fylke) { switch (GetType().Name) { case ("City"): m_type = LocationType.City; break; case ("Region"): m_type = LocationType.Region; break; default: m_type = LocationType.City; break; } m_name = name; m_fylke = fylke; }
public async Task GetExistingAdvertisementUsingHalSelfLink(LocationType locationType, string givenStatement) { const string advertisementId = "8e2fde50-bc5f-4a12-9cfb-812e50500184"; OAuth2Token oAuth2Token = new OAuth2TokenBuilder().Build(); var link = $"{AdvertisementLink}/{advertisementId}"; var viewRenderedAdvertisementLink = $"{AdvertisementLink}/{advertisementId}/view"; var builderInitializer = new AllFieldsInitializer(locationType); this.SetupPactForGettingExistingAdvertisement(givenStatement, link, oAuth2Token, builderInitializer, advertisementId, viewRenderedAdvertisementLink); AdvertisementResource result; using (AdPostingApiClient client = this.Fixture.GetClient(oAuth2Token)) { result = await client.GetAdvertisementAsync(new Uri(this.Fixture.AdPostingApiServiceBaseUri, link)); } this.AssertRetrievedAdvertisementMatchesExpected(builderInitializer, advertisementId, result); }
/// <summary> /// /// </summary> /// <param name="locations"></param> /// <param name="locationType"></param> /// <param name="geoLocation"></param> /// <returns></returns> private ElasticsearchLocation GetParentLocationOfCity(List <ElasticsearchLocation> locations, LocationType locationType, GeoLocation geoLocation) { var parent = locations.SingleOrDefault(x => x.Division3Code == geoLocation.Admin3Code && x.TypeID == (int)LocationType.ThirdOrderDivision); if (parent != null) { return(parent); } parent = locations.SingleOrDefault(x => x.Division2Code == geoLocation.Admin2Code && x.TypeID == (int)LocationType.SecondOrderDivision); if (parent != null) { return(parent); } parent = locations.SingleOrDefault(x => x.Division1Code == geoLocation.Admin1Code && x.TypeID == (int)LocationType.FirstOrderDivision); if (parent != null) { return(parent); } parent = locations.SingleOrDefault(x => x.CountryCode == geoLocation.CountryCode && x.TypeID == (int)LocationType.Country); if (parent != null) { return(parent); } return(null); }
public void ChangeLocation(LocationType loc) { _location = loc; }
public static string Path(this IStreamProvider streamProvider, LocationType type, string tableName, CrawlType crawlType) { return(System.IO.Path.Combine(type.ToString(), tableName, crawlType.ToString())); }
internal void CalculateAgentFee(LocationType location, double Surface, bool CompartmentType, bool ParkingSpace, bool Balcony, bool Floor, bool Furnished, double BasicFee, double BuildingBasicPrice) { double agentfee = BasicFee * TotalPrice; switch (location) { case LocationType.Center: { agentfee = agentfee + 0.02 * LocationFee(location, BuildingBasicPrice); if (Surface > 100) { agentfee = agentfee + 0.02 * SurfaceFee(Surface); } else if (Surface < 100 && Surface > 70) { agentfee = agentfee + 0.015 * SurfaceFee(Surface); } else { agentfee = agentfee + 0.01 * SurfaceFee(Surface); } if (CompartmentType == true) { agentfee = agentfee + 0.003 * CompartTypeFee(CompartmentType, BuildingBasicPrice); } else { agentfee += 0; } if (ParkingSpace == true) { agentfee += 0.007 * ParkingSpaceFee(ParkingSpace, BuildingBasicPrice); } else { agentfee += 0; } break; } case LocationType.Tudor: { agentfee = agentfee + 0.018 * LocationFee(location, BuildingBasicPrice); if (Surface > 100) { agentfee = agentfee + 0.019 * SurfaceFee(Surface); } else if (Surface < 100 && Surface > 70) { agentfee = agentfee + 0.015 * SurfaceFee(Surface); } else { agentfee = agentfee + 0.01 * SurfaceFee(Surface); } if (CompartmentType == true) { agentfee = agentfee + 0.003 * CompartTypeFee(CompartmentType, BuildingBasicPrice); } else { agentfee += 0; } if (ParkingSpace == true) { agentfee += 0.005 * ParkingSpaceFee(ParkingSpace, BuildingBasicPrice); } else { agentfee += 0; } break; } case LocationType.Bucium: { agentfee = agentfee + 0.01 * LocationFee(location, BuildingBasicPrice); if (Surface > 100) { agentfee = agentfee + 0.02 * SurfaceFee(Surface); } else if (Surface < 100 && Surface > 70) { agentfee = agentfee + 0.015 * SurfaceFee(Surface); } else { agentfee = agentfee + 0.01 * SurfaceFee(Surface); } if (CompartmentType == true) { agentfee = agentfee + 0.001 * CompartTypeFee(CompartmentType, BuildingBasicPrice); } else { agentfee += 0; } if (ParkingSpace == true) { agentfee += 0.003 * ParkingSpaceFee(ParkingSpace, BuildingBasicPrice); } else { agentfee += 0; } break; } default: break; } Console.WriteLine("The fee for the real estate agent is :" + agentfee); Console.ReadKey(); }
public ItemVersions(LocationType locationType, string name) { this.LocationType = locationType; this.Name = name; this.Versions = new List <ItemVersion>(); }
public string GetFilter(LocationType locationType) { return("Secured Threat Model (*.tmx)|*.tmx"); }
/// <summary> /// /// </summary> /// <param name="locations"></param> /// <param name="locationType"></param> /// <param name="locationView"></param> /// <returns></returns> private ElasticsearchLocation GetParentLocation(List <ElasticsearchLocation> locations, LocationType locationType, LocationView locationView) { if (locationType == LocationType.Country) { return(null); } if (_previousId == locationView.Id) { return(_parentLocation); } _previousId = GetParentId(locationView); _parentLocation = locations.SingleOrDefault(x => x.ID == _previousId); return(_parentLocation); }
public bool CanHandle(LocationType locationType, string location) { return(SupportedLocations.HasFlag(locationType) && string.Compare(Path.GetExtension(location), ".tmx", StringComparison.OrdinalIgnoreCase) == 0); }
public bool Save(IThreatModel model, LocationType locationType, string location) { throw new EncryptionRequiredException(RequiredProtection); }
public IThreatModel Load(LocationType locationType, string location, X509Certificate2 certificate) { throw new UnsupportedEncryptionException(); }
public void Delete(LocationType location) { _context.LocationTypes.Remove(location); }
/// <summary> /// 初始化 /// </summary> public virtual CLocationBase CreateProcessor(LocationType type) { return(null); }
public GatheringLocation(string name, LocationType type, ItemType gatheredItemItem, ItemType requiredItemType) : base(name, type) { this.GatheredItem = gatheredItemItem; this.RequiredItem = requiredItemType; }
public string GetFilter(LocationType locationType) { return("Threat Model (*.tm)|*.tm"); }
public bool CanHandle(LocationType locationType, [Required] string location) { return(SupportedLocations.HasFlag(locationType) && !location.StartsWith(@"\\") && string.Compare(Path.GetExtension(location), ".tm", StringComparison.OrdinalIgnoreCase) == 0); }
public Location(Region region, int id, int address, LocationType type, string name) : this(region, id, address, type, name, items => true) { }
public Coordinate(double lat, double lon, LocationType loctype) { Lat = lat; Lon = lon; Loctype = loctype; }
public bool Save(IThreatModel model, LocationType locationType, string location, IEnumerable <X509Certificate2> certificates) { throw new UnsupportedEncryptionException(); }
public static string Path(this IStreamProvider streamProvider, LocationType type, string tableName, CrawlType crawlType, DateTime version) { return(System.IO.Path.Combine(type.ToString(), tableName, crawlType.ToString(), version.ToUniversalTime().ToString(DateTimeFolderFormat))); }
public IThreatModel Load(LocationType locationType, string location) { throw new EncryptionRequiredException(RequiredProtection); }
public StartingLocation(string name, string areaName, LocationType type, Vector3 position, Vector3 rotation, float initialVelocity, bool isRunwayTakeoff) { this.RealObject = CreateUnwrapped(name, areaName, (int)type, position, rotation, initialVelocity, isRunwayTakeoff, null); }
public void SetLocationActive(LocationType type, bool active) { activatedLocations[type] = active; }
public override int GetHashCode() { return(LocationType.GetHashCode() ^ Name.GetHashCode() ^ CrawlType.GetHashCode() ^ AsOfDate.GetHashCode()); }
/// <summary> /// Creates a new location /// </summary> /// <param name="locationID">ID number of the location</param> /// <param name="locationName">Unique internal name for location</param> /// <param name="displayedName">Name to be displayed on the map</param> /// <param name="chapterUnlocked">Earliest chapter the location is unlocked</param> /// <param name="locationType">Describes the controls of the location. Static = Cursor, Moveable = Walking, Trial = No controls</param> public Location(int locationID, string locationName, string displayedName, int chapterUnlocked, LocationType locationType) { id = locationID; name = locationName; display = displayedName; unlock = chapterUnlocked; type = locationType; }
/// <summary> /// Construct a Label with On, Left and Right locations for both Geometries. /// Initialize the locations for the given Geometry index. /// </summary> /// <param name="geomIndex"></param> /// <param name="onLoc"></param> /// <param name="leftLoc"></param> /// <param name="rightLoc"></param> public Label(int geomIndex, LocationType onLoc, LocationType leftLoc, LocationType rightLoc) { _elt[0] = new TopologyLocation(LocationType.Null, LocationType.Null, LocationType.Null); _elt[1] = new TopologyLocation(LocationType.Null, LocationType.Null, LocationType.Null); _elt[geomIndex].SetLocations(onLoc, leftLoc, rightLoc); }
private void LabelLocationType(Graphics drawOn, Font textFont, List<RectangleF> usedLabelRects, LocationType typeToDraw) { foreach (Hotspot h in mHotspots) { if ((h.loc.Type & typeToDraw) != 0) { SizeF txtSize = drawOn.MeasureString(h.loc.Name, textFont); float mX = (h.rect.Left + h.rect.Right) / 2.0f; float mY = (h.rect.Top + h.rect.Bottom) / 2.0f; float mbY = (h.rect.Top + 3 * h.rect.Bottom) / 4.0f; RectangleF[] tryRects = { // Bottom, Top, BelowCenter, Right, Left new RectangleF(new PointF(mX - txtSize.Width / 2.0f, h.rect.Bottom - 1), txtSize), new RectangleF(new PointF(mX - txtSize.Width / 2.0f, h.rect.Top - txtSize.Height + 1), txtSize), new RectangleF(new PointF(mX - txtSize.Width / 2.0f, mbY - txtSize.Height / 2.0f), txtSize), new RectangleF(new PointF(h.rect.Right - 1, mY - txtSize.Height / 2.0f), txtSize), new RectangleF(new PointF(h.rect.Left - txtSize.Width + 1, mY - txtSize.Height / 2.0f), txtSize), //// Farther Below, Above, Right, Left //new RectangleF(new PointF(mX - txtSize.Width / 2.0f, h.rect.Bottom + 4), txtSize), //new RectangleF(new PointF(mX - txtSize.Width / 2.0f, h.rect.Top - txtSize.Height - 4), txtSize), //new RectangleF(new PointF(h.rect.Right + 4, mY - txtSize.Height / 2.0f), txtSize), //new RectangleF(new PointF(h.rect.Left - txtSize.Width - 4, mY - txtSize.Height / 2.0f), txtSize), // Corners: TopRight, BottomRight, TopLeft, BottomLeft new RectangleF(new PointF(h.rect.Right - 1, h.rect.Top - txtSize.Height + 1), txtSize), new RectangleF(new PointF(h.rect.Right - 1, h.rect.Bottom - 1), txtSize), new RectangleF(new PointF(h.rect.Left - txtSize.Width + 1, h.rect.Top - txtSize.Height + 1), txtSize), new RectangleF(new PointF(h.rect.Left - txtSize.Width + 1, h.rect.Bottom - 1), txtSize), }; for (int i = 0; i < tryRects.Length; i++) { bool intersects = false; foreach (RectangleF usedRect in usedLabelRects) { if (tryRects[i].IntersectsWith(usedRect)) { intersects = true; break; } } if (!intersects) { PointF p = tryRects[i].Location; drawOn.DrawString(h.loc.Name, textFont, TextGlow1, new PointF(p.X - 1, p.Y)); drawOn.DrawString(h.loc.Name, textFont, TextGlow1, new PointF(p.X, p.Y - 1)); drawOn.DrawString(h.loc.Name, textFont, TextGlow1, new PointF(p.X + 1, p.Y)); drawOn.DrawString(h.loc.Name, textFont, TextGlow1, new PointF(p.X, p.Y + 1)); drawOn.DrawString(h.loc.Name, textFont, Brushes.White, p); usedLabelRects.Add(tryRects[i]); break; } } } } }
private void newGame_btn_Click(object sender, EventArgs e) { createDrawInterface(hero); createTowns(); CreateSuburbs(); currentLocation = LocationType.Town; drawScene(); }
protected override void Seed(LogBook.Models.LogBook.LogBook context) { // This method will be called after migrating to the latest version. // You can use the DbSet<T>.AddOrUpdate() helper extension method // to avoid creating duplicate seed data. var signalLocation = new LocationType { Description = "Signal" }; var rwisLocation = new LocationType { Description = "RWIS" }; context.LocationTypes.AddOrUpdate(l => l.Description, signalLocation, rwisLocation); var complaint = new ReasonForResponse { Id = 1, Description = "Complaint/Work Order", DisplayOrder = 1, Abbreviation = "CW" }; var pmRm = new ReasonForResponse { Id = 2, Description = "Preventative Maintenance", DisplayOrder = 2, Abbreviation = "PM", Group = "General" }; var afterHours = new ReasonForResponse { Id = 3, Description = "On-call/After Hours", DisplayOrder = 3, Abbreviation = "EMR", Group = "General" }; var maintenanceEquipment = new ReasonForResponse { Id = 4, Description = "Failed Equipment", DisplayOrder = 4, Abbreviation = "E", Group = "WO" }; var maintenanceDetection = new ReasonForResponse { Id = 5, Description = "Detection Related", DisplayOrder = 5, Abbreviation = "D", Group = "WO" }; var timing = new ReasonForResponse { Id = 6, Description = "Timing", DisplayOrder = 6, Abbreviation = "T", Group = "WO" }; var other = new ReasonForResponse { Id = 7, Description = "Other", DisplayOrder = 7, Abbreviation = "O", Group = "General" };; context.ReasonForResponses.AddOrUpdate( r => r.Id, complaint, pmRm, afterHours, other, maintenanceEquipment, maintenanceDetection, timing ); context.SaveChanges(); context.Logs.AddOrUpdate(new Log { User = "******", LocationId = "7220", ReasonForResponses = new List <ReasonForResponse> { timing, afterHours }, LocationType = signalLocation, Timestamp = DateTime.Now, Comment = "This is a test comment.", Onsite = true, DateCreated = DateTime.Now }); }
public static string Path(this IStreamProvider streamProvider, LocationType type, string tableName, string extension) { return(System.IO.Path.Combine(type.ToString(), tableName + extension)); }
/// <summary> /// Construct a Label with On, Left and Right locations for both Geometries. /// Initialize the locations for both Geometries to the given values. /// </summary> /// <param name="onLoc"></param> /// <param name="leftLoc"></param> /// <param name="rightLoc"></param> public Label(LocationType onLoc, LocationType leftLoc, LocationType rightLoc) { _elt[0] = new TopologyLocation(onLoc, leftLoc, rightLoc); _elt[1] = new TopologyLocation(onLoc, leftLoc, rightLoc); }
public Location(string name, LocationType type) : base(name) { this.LocationType = type; }
private void DrawLocationType(Dictionary<LocationType, List<Location>> visible, LocationType typeToDraw, Bitmap imageToUse, Graphics drawOn, float zoom, float imageZoom) { List<Location> locs; List<Location> portalHubs; if ((typeToDraw & LocationType.AnyPortal) == 0 || !visible.TryGetValue(LocationType.PortalHub, out portalHubs)) { portalHubs = null; } if (visible.TryGetValue(typeToDraw, out locs)) { float zw = imageZoom * imageToUse.Width; float zh = imageZoom * imageToUse.Height; foreach (Location loc in locs) { PointF ptf = CoordsToPix(loc.Coords, zoom); RectangleF rectf = new RectangleF(ptf.X - zw / 2, ptf.Y - zh / 2, zw, zh); bool draw = true; // Hide portals that overlap a portal hub // (likely that the portal is part of the hub) if (portalHubs != null) { foreach (Location portalHub in portalHubs) { PointF portalHubPt = CoordsToPix(portalHub.Coords, zoom); if (rectf.Contains(portalHubPt)) { draw = false; break; } } } if (draw) { drawOn.DrawImage(loc.IsFavorite ? Icons.Map.Favorite : imageToUse, rectf); Rectangle rect = new Rectangle(Point.Truncate(rectf.Location), Size.Ceiling(rectf.Size)); mHotspots.AddFirst(new Hotspot(rect, loc)); } } } }
private static void LoadCases(Range xlRange) { //Get result count int resultCount = 0; int rowIndex = 4; while ((xlRange.Cells[rowIndex, 4] as Range).Value2 != null) { ++resultCount; ++rowIndex; } m_resultCount = resultCount; //Get LocationType string locationTypeRaw = (xlRange.Cells[1, 2] as Range).Value2; LocationType = (LocationType)Enum.Parse(typeof(LocationType), locationTypeRaw); //Get Keyword Keyword = (xlRange.Cells[2, 2] as Range).Value2; //Get expected number of results ExpectedNumberOfResults = (int)(xlRange.Cells[3, 2] as Range).Value2; SubTypeCases = new object[m_resultCount]; NameCases = new object[m_resultCount]; DetailedNameCases = new object[m_resultCount]; IdCases = new object[m_resultCount]; TimeZoneOffsetCases = new object[m_resultCount]; IataCodeCases = new object[m_resultCount]; GeoCodeCases = new object[m_resultCount]; CityCases = new object[m_resultCount]; CountryCases = new object[m_resultCount]; RegionCases = new object[m_resultCount]; const int baseRowIndex = 4; for (int i = 0; i < m_resultCount; ++i) { //Get SubType Case LocationType subType = (LocationType)Enum.Parse(typeof(LocationType), (xlRange.Cells[baseRowIndex + i, 5] as Range).Value2); SubTypeCases[i] = new object[] { i, subType }; //Get Name Case string name = (xlRange.Cells[baseRowIndex + i, 6] as Range).Value2; NameCases[i] = new object[] { i, name }; //Get DetailedName Case string detailedName = (xlRange.Cells[baseRowIndex + i, 7] as Range).Value2; DetailedNameCases[i] = new object[] { i, detailedName }; //Get Id Case string id = (xlRange.Cells[baseRowIndex + i, 8] as Range).Value2; IdCases[i] = new object[] { i, id }; //Get TimeZoneOffset Case TimeSpan timeZoneOffset = TimeSpan.Parse((xlRange.Cells[baseRowIndex + i, 9] as Range).Value2.ToString()); TimeZoneOffsetCases[i] = new object[] { i, timeZoneOffset }; //Get IataCode Case string iataCode = (xlRange.Cells[baseRowIndex + i, 10] as Range).Value2; IataCodeCases[i] = new object[] { i, iataCode }; //Get GeoCode Case float latitude = (float)(xlRange.Cells[baseRowIndex + i, 11] as Range).Value2; float longitude = (float)(xlRange.Cells[baseRowIndex + i, 12] as Range).Value2; GeoCodeCases[i] = new object[] { i, latitude, longitude }; //Get City Case string cityName = (xlRange.Cells[baseRowIndex + i, 13] as Range).Value2; string cityCode = (xlRange.Cells[baseRowIndex + i, 14] as Range).Value2; CityCases[i] = new object[] { i, cityName, cityCode }; //Get Country Case string countryName = (xlRange.Cells[baseRowIndex + i, 15] as Range).Value2; string countryCode = (xlRange.Cells[baseRowIndex + i, 16] as Range).Value2; CountryCases[i] = new object[] { i, countryName, countryCode }; //Get Region Case string regionCode = (xlRange.Cells[baseRowIndex + i, 17] as Range).Value2; RegionCases[i] = new object[] { i, regionCode }; } }
private void gameField_MouseClick(object sender, MouseEventArgs e) { Color clr = new Color(); clr = Color.White; try { switch (currentLocation) { case LocationType.Town: { for (int i = 0; i < towns[currentTownId - 1].Objects.Count; i++) // ! { clr = towns[currentTownId - 1].Objects[i].CheckHitCoords(e.Location); if (clr != Color.White) { break; } } } break; case LocationType.Suburb: { for (int i = 0; i < suburbs[currentTownId - 1].Objects.Count; i++) // ! { clr = suburbs[currentTownId - 1].Objects[i].CheckHitCoords(e.Location); if (clr != Color.White) { break; } } } break; } } catch { Exception ex; } if (clr == Color.Red) { MessageBox.Show("Красный"); } else { if (clr == Color.Green) { MessageBox.Show("Зеленый"); } else { if (clr == Color.DarkOrange) { currentLocation = LocationType.Suburb; drawScene(); } else { if (clr == Color.SandyBrown) { currentLocation = LocationType.Town; drawScene(); } } } } }
public double GetChanceOfAttack(IPlayerCharacter character, IMonster monster, LocationType locationType) { return(0.5); }
protected GatheringLocation(string name, LocationType locType, ItemType gatheredType, ItemType requiredItem) : base(name, locType) { this.GatheredType = gatheredType; this.RequiredItem = requiredItem; }
/// <summary> /// Input: /// Y (0.0, 1.0) = (0, max) - normalized y axis value /// Output: /// Chance (0.0, 1.0) = change of type on given y pos /// </summary> /// <param name="type"></param> /// <param name="func"></param> /// <returns></returns> public MapSettings WithChance(LocationType type, Func <double, double> func) { ChanceByYAxis.Add(type, func); return(this); }