/// <summary> /// Initializes a new instance of the Spot class. /// Use for railroads and utilities /// </summary> /// <param name="spotId">The id of the spot</param> /// <param name="spotName">The name of the spot</param> /// <param name="type">The type of spot</param> /// <param name="price">The price to buy the property</param> /// <param name="rent">The amount a player pays when they land on a property that is owned by another player</param> public Spot(int spotId, string spotName, SpotType type, int price, int rent) { this.SpotId = spotId; this.SpotName = spotName; this.Type = type; this.Color = Color.Black; this.Price = price; this.Rent = rent; this.Rent1House = 0; this.Rent2Houses = 0; this.Rent3Houses = 0; this.Rent4Houses = 0; this.RentHotel = 0; this.HouseCost = 0; this.HotelCost = 0; this.IsAvailable = true; this.IsMortgaged = false; this.NumberOfHouses = 0; this.HasHotel = false; this.Owner = null; this.SpotBox = new PictureBox(); if (type == SpotType.Railroad) { this.Mortgage = 100; } else if (type == SpotType.Utility) { this.Mortgage = 75; } }
public ActionResult Edit([Bind(Include = "SpotGuid,SpotName,Description,Longitude,Latitude,TypeGuid")] SpotEditViewModel spotEditViewModel) { var spotTypeFind = dbSpotTypes.SpotsTypes.First(x => x.SpotGuid == spotEditViewModel.SpotGuid); var spotTypeGuid = spotTypeFind.SpotTypeGuid; if (ModelState.IsValid) { Spot spot = db.Spots.Find(spotEditViewModel.SpotGuid); spot.SpotName = spotEditViewModel.SpotName; spot.Description = spotEditViewModel.Description; spot.Longitude = spotEditViewModel.Longitude; spot.Latitude = spotEditViewModel.Latitude; spot.DateModified = DateTime.Now; spot.UserModifiedID = Auxiliaries.GetUserId(User); SpotType spotType = dbSpotTypes.SpotsTypes.Find(spotTypeGuid); spotType.TypeGuid = spotEditViewModel.TypeGuid; spotType.DateModified = DateTime.Now; db.Entry(spot).State = EntityState.Modified; db.SaveChanges(); dbSpotTypes.Entry(spotType).State = EntityState.Modified; dbSpotTypes.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.TypeGuid = new SelectList(dbTypes.Types, "TypeGuid", "TypeName", spotEditViewModel.TypeGuid); return(View(spotEditViewModel)); }
public ParkingSpot(SpotType spotType, int floor, int sequenceNo) { this.SpotType = spotType; this.Floor = floor; this.SpotNo = Guid.NewGuid(); this.SequenceNo = sequenceNo; }
// // Constructors // // A card with an owner public Card(SuitType suit, SpotType spot, object owner) { // Force a joker if one is requested. if (suit == SuitType.Joker) // Little { spot = SpotType.Joker; } else if (spot == SpotType.Joker) { suit = SuitType.Joker; } else if (suit == SuitType.BigJoker) // Big { spot = SpotType.BigJoker; } else if (spot == SpotType.BigJoker) { suit = SuitType.BigJoker; } // Initalize the fields Suit = suit; Spot = spot; Owner = owner; }
void Start() { rb = GetComponent <Rigidbody2D>(); prevSpot = SpotType.Center; centerSpot = new Vector2(0, transform.position.y); targetPosition = GetNewTargetPosition(); }
// // Constructors // // A card with an owner public Card(SuitType suit, SpotType spot, object owner) { // Force a joker if one is requested. if (suit == SuitType.Joker) // Little { spot = SpotType.Joker; } else if (spot == SpotType.Joker) { suit = SuitType.Joker; } else if (suit == SuitType.BigJoker) // Big { spot = SpotType.BigJoker; } else if (spot == SpotType.BigJoker) { suit = SuitType.BigJoker; } // Initalize the fields Suit = suit; Spot = spot; Owner = owner; }
void Start() { holdingItem = Item.NONE; facingSpotType = SpotType.NONE; controller = GetComponent <CharacterController>(); animator = GetComponent <Animator>(); }
/* * MovementDirection MovementDirection WhichWayToTarget( * MapSpot WhereIAm, * SpotType targetType * ) * * Returns MovementDirection that begins the shortest path to a spot of type targetType. */ public static MovementDirection WhichWayToTargetType( MapSpot WhereIAm, SpotType targetType ) { // Defines and assigns delegate function we will use when checking // the spots we've found. bool spotCheck(MapSpot test) { return(test.myType == targetType); } PathFinder.checkSpot = spotCheck; // We can take advantage of the pathfinding algorithm to find // our target Dictionary <MapSpot, MapSpot> pathEdges = PathFinder.CreatePathEdges(WhereIAm); // Use the same function we used for the delgate to get the right MapSpot MapSpot targetSpot = pathEdges.Keys.ToList().Find(spotCheck); if (targetSpot == null) { targetSpot = WhereIAm; } return(PathFinder.FindPathInitialDirection(targetSpot, WhereIAm, pathEdges)); }
/// <summary> /// Finds the nearest spot that matches the spot type given /// </summary> /// <param name="board">The list of all spots on the board</param> /// <param name="type">The type of spot to look for like property or railroad or utility</param> /// <returns>The nearest spot of given type</returns> public Spot FindNearestSpotOfGivenType(List <Spot> board, SpotType type) { // Loop through the spots on the board starting at the one after the current one the player is on to the last spot on the board for (int i = this.SpotId + 1; i < board.Count; i++) { // If the type of the current spot equals the type given as a parameter if (board[i].Type == type) { // return that spot return(board[i]); } } // Loop through the spots on the board starting at Go until the spot right before the spot the current player is on for (int i = 0; i < this.SpotId; i++) { // If the type of the current spot equals the type given as a parameter if (board[i].Type == type) { // return that spot return(board[i]); } } // No spot of given type was found return(null); }
public ActionResult Create([Bind(Include = "SpotName,Description,Longitude,Latitude,TypeGuid")] Spot spot) { if (ModelState.IsValid) { spot.SpotGuid = Guid.NewGuid(); spot.DateCreated = DateTime.Now; spot.DateModified = spot.DateCreated; spot.UserCreatedID = Auxiliaries.GetUserId(User); spot.UserModifiedID = Auxiliaries.GetUserId(User); SpotType spotType = new SpotType(); spotType.SpotTypeGuid = Guid.NewGuid(); spotType.SpotGuid = spot.SpotGuid; spotType.TypeGuid = spot.TypeGuid; spotType.DateCreated = DateTime.Now; spotType.DateModified = spotType.DateCreated; db.Spots.Add(spot); db.SaveChanges(); dbSpotTypes.SpotsTypes.Add(spotType); dbSpotTypes.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.TypeGuid = new SelectList(dbTypes.Types, "TypeGuid", "TypeName", spot.TypeGuid); return(View(spot)); }
public SpotDesc(ushort objectPointServerHash, string objectPointName, SpotType type, Vector3 localPosition, Quaternion localRotation) { ObjectPointServerHash = objectPointServerHash; ObjectPointName = objectPointName; Type = type; LocalPosition = localPosition; LocalRotation = localRotation; }
public bool IsParkingAvailable(SpotType requiredSpotType, out int floor) { floor = AtomicOperation <int>(() => { throw new NotImplementedException(); }); return(floor != int.MinValue); }
private Spot findSpotForVehicleType(SpotType vehicleType) { // You may want to set priority on floor number // many consideratin can be done // algo for selection return(null); }
public Ticket Entry(string _registrationNumber, SpotType _vehicleType) { Car car = new Car { RegistrationNumber = _registrationNumber, vehicleType = _vehicleType, }; Spot _spot = findSpotForVehicleType(_vehicleType); Ticket ticket = null; if (_spot != null) { _spot.arrivalTime = DateTime.Now; _spot.vehicle = car; car.spot = _spot; ticket = new Ticket { spot = _spot, rateCard = this.rateCard }; } else { Console.WriteLine("Hey! Looks like there is no parking for your vehicle, would " + "you want to try for upgraded parking at a higher rate. Yes/No"); string selection = Console.ReadLine(); if (selection.Equals("Yes")) { Spot spotForVehicle = findSpot(); if (spotForVehicle == null) { return(null); } spotForVehicle.arrivalTime = DateTime.Now; spotForVehicle.vehicle = car; car.spot = _spot; ticket = new Ticket { spot = spotForVehicle, rateCard = this.rateCard }; } else { return(null); } } return(ticket); }
//---------------------------------------------------------- //Constructor public GridSpot(GameObject obj, IVector3 pos) { _direction = ComponentDirection.LEFT; _position = pos; _componentAttached = null; _obj = obj; _type = SpotType.EMPTY; _siblings = new List <GridSpot>(); _eldest = pos; _secondaryDirection = ComponentDirection.FRONT; }
//Change type of spot at X,Y,Z public void SetSpotToType(SpotType newType, int X, int Y, int Z) { if (isOnGrid(X, Y, Z)) { _grid [X, Y, Z].type = newType; //Debug.Log ("Type changed to " + newType + " at " + new IVector3 (X, Y, Z)); } else { Debug.LogError("OMG Off the grid error"); } }
public void ParkCar(SpotType spotType = SpotType.Regular) { if (this._isEmpty) { throw new Exception("Unable to park in spot that is already occupied"); } if (this.Type != SpotType.Regular || this.Type != spotType) { throw new Exception("Cannot park in designated spot"); } this._isEmpty = false; }
public FormFlightDatesChangeWarning(SpotType spotType) { InitializeComponent(); simpleLabelItemTitle.Text = String.Format(simpleLabelItemTitle.Text, spotType); layoutControlItemKeepSpots.MaxSize = RectangleHelper.ScaleSize(layoutControlItemKeepSpots.MaxSize, Utilities.GetScaleFactor(CreateGraphics().DpiX)); layoutControlItemKeepSpots.MinSize = RectangleHelper.ScaleSize(layoutControlItemKeepSpots.MinSize, Utilities.GetScaleFactor(CreateGraphics().DpiX)); layoutControlItemDoNotKeepSpots.MaxSize = RectangleHelper.ScaleSize(layoutControlItemDoNotKeepSpots.MaxSize, Utilities.GetScaleFactor(CreateGraphics().DpiX)); layoutControlItemDoNotKeepSpots.MinSize = RectangleHelper.ScaleSize(layoutControlItemDoNotKeepSpots.MinSize, Utilities.GetScaleFactor(CreateGraphics().DpiX)); layoutControlItemOK.MaxSize = RectangleHelper.ScaleSize(layoutControlItemOK.MaxSize, Utilities.GetScaleFactor(CreateGraphics().DpiX)); layoutControlItemOK.MinSize = RectangleHelper.ScaleSize(layoutControlItemOK.MinSize, Utilities.GetScaleFactor(CreateGraphics().DpiX)); layoutControlItemCancel.MaxSize = RectangleHelper.ScaleSize(layoutControlItemCancel.MaxSize, Utilities.GetScaleFactor(CreateGraphics().DpiX)); layoutControlItemCancel.MinSize = RectangleHelper.ScaleSize(layoutControlItemCancel.MinSize, Utilities.GetScaleFactor(CreateGraphics().DpiX)); }
public void DetectSpot(SpotType spotType) { if (TasteLiked.Where(ts => ts.SpotType == spotType) != null) { BeneficEffect(); return; } if (TasteHated.Where(ts => ts.SpotType == spotType) != null) { MalusEffect(); return; } }
public static string GetDisplayName(this SpotType type) { MemberInfo[] memInfo = _enumType.GetMember(type.ToString()); var attribute = memInfo[0].GetCustomAttribute <EnumDisplayNameAttribute>(false); string value = null; if (attribute != null) { value = attribute.Value; } return(value); }
public FormFlightDatesChangeWarning(SpotType spotType) { InitializeComponent(); labelControlTitle.Text = String.Format(labelControlTitle.Text, spotType); if ((CreateGraphics()).DpiX > 96) { var font = new Font(styleController.Appearance.Font.FontFamily, styleController.Appearance.Font.Size - 2, styleController.Appearance.Font.Style); styleController.Appearance.Font = font; styleController.AppearanceDisabled.Font = font; styleController.AppearanceDropDown.Font = font; styleController.AppearanceDropDownHeader.Font = font; styleController.AppearanceFocused.Font = font; styleController.AppearanceReadOnly.Font = font; buttonXKeepSpots.Font = new Font(buttonXKeepSpots.Font.FontFamily, buttonXKeepSpots.Font.Size - 2, buttonXKeepSpots.Font.Style); buttonXDoNotKeepSpots.Font = new Font(buttonXDoNotKeepSpots.Font.FontFamily, buttonXDoNotKeepSpots.Font.Size - 2, buttonXDoNotKeepSpots.Font.Style); buttonXSave.Font = new Font(buttonXSave.Font.FontFamily, buttonXSave.Font.Size - 2, buttonXSave.Font.Style); buttonXCancel.Font = new Font(buttonXCancel.Font.FontFamily, buttonXCancel.Font.Size - 2, buttonXCancel.Font.Style); } }
public Transform OnRelease(hand _playerHand) { transform.localScale = originSize; transform.rotation = Quaternion.identity; if (transform.position.z < 0.0f) { // delete from hand _playerHand.GetOutOfList(gameObject.transform); // attach to single test position transform.position = singleTest.position; _mySpot = SpotType.SingleTest; return(transform); } else { _playerHand.GetOutOfList(gameObject.transform); Debug.Log("Goes to flow test."); switch (_myType) { case ModuleType.Tire: transform.position = flowTest[0].position; break; case ModuleType.Door: transform.position = flowTest[1].position; break; case ModuleType.Body: transform.position = flowTest[2].position; break; default: Debug.Log("Weird, shoundn't be default"); break; } _mySpot = SpotType.FlowTest; return(transform); } }
/// <summary> /// Initializes a new instance of the Spot class. /// Use for Chance, Community Chest, Go, Jail, Go to Jail, Free Parking /// </summary> /// <param name="spotId">The id of the spot</param> /// <param name="spotName">The name of the spot</param> /// <param name="type">The type of spot</param> public Spot(int spotId, string spotName, SpotType type) { this.SpotId = spotId; this.SpotName = spotName; this.Type = type; this.Color = Color.Black; this.Price = 0; this.Rent = 0; this.Rent1House = 0; this.Rent2Houses = 0; this.Rent3Houses = 0; this.Rent4Houses = 0; this.RentHotel = 0; this.Mortgage = 0; this.HouseCost = 0; this.HotelCost = 0; this.IsAvailable = true; this.IsMortgaged = false; this.NumberOfHouses = 0; this.HasHotel = false; this.Owner = null; this.SpotBox = new PictureBox(); }
private Vector2 SelectSpotPosition() { SpotType spot; do { spot = (SpotType)UnityEngine.Random.Range(0, 3); }while (spot == prevSpot); prevSpot = spot; if (spot == SpotType.Left) { return(leftSpot); } else if (spot == SpotType.Center) { return(centerSpot); } else { return(rightSpot); } }
override public void ParseCsv(string[] csv) { // 编号 名称 据点素材 单位类型 增加属性1 增加属性2 增加属性3 // id name spotAvatar unitType property1 property2 property3 int i = 0; // 编号 id = csv.GetInt32(i++); // 名称 name = csv.GetString(i++); // 据点类型 spotType = (SpotType)csv.GetInt32(i++); // 素材 avatarId = csv.GetInt32(i++); // 单位类型 unitType = (UnitType)csv.GetInt32(i++); // 属性 props = PropConfigUtils.ParsePropFields(csv, i); War.model.AddBuildSpotConfig(this); }
public CostColumnInfo(SpotType spotType) { _spotType = spotType; }
public Vehicle(string no, VehicleType vehicleType, SpotType requiredSpotType) { this.No = no; this.Type = vehicleType; this.RequiredSpotType = requiredSpotType; }
// IsJokerSpot //////////////////////////////////// public static bool IsJokerSpot(SpotType spot) { return spot == SpotType.BigJoker || spot == SpotType.Joker; }
private ParkingSpot CheckSpot(SpotType requiredSpotType) { throw new NotImplementedException(); }
public AbstractTextEffect PlaySpot(SpotType spotType, Transform transform) { return(Play(TextEffectType.Spot, spotType, Color.white, transform.position + new Vector3(4, 2, 0), transform)); }
void updateFollowingHourMap(SpotType spotType, float val) { this.followingHourRateCard.Add(spotType, val); }
void updateFirstHourMap(SpotType spotType, float val) { this.firstHourRateCard.Add(spotType, val); }
// A card with no owner public Card(SuitType suit, SpotType spot) : this(suit, spot, null) { }
// IsJokerSpot //////////////////////////////////// public static bool IsJokerSpot(SpotType spot) { return(spot == SpotType.BigJoker || spot == SpotType.Joker); }
// A card with no owner public Card(SuitType suit, SpotType spot) : this(suit, spot, null) { }
public TotalPeriodsColumnInfo(SpotType spotType) { _spotType = spotType; }
public SpotsColumnInfo(SpotType spotType) { _spotType = spotType; }
public void Deserialize(XmlNode node) { foreach (XmlNode childNode in node.ChildNodes) switch (childNode.Name) { case "UniqueID": { Guid temp; if (Guid.TryParse(childNode.InnerText, out temp)) UniqueID = temp; } break; case "Index": { double temp; if (Double.TryParse(childNode.InnerText, out temp)) Index = temp; } break; case "Name": Name = childNode.InnerText; break; case "Logo": Logo = new ImageSource(); Logo.Deserialize(childNode); break; case "Comment": Comment = childNode.InnerText; break; case "TotalPeriods": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) TotalPeriods = temp; } break; case "ShowLineId": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowLineId = temp; } break; case "ShowLogo": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowLogo = temp; } break; case "ShowStation": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowStation = temp; } break; case "ShowProgram": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowProgram = temp; } break; case "ShowDay": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowDay = temp; } break; case "ShowLenght": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowLenght = temp; } break; case "ShowTime": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowTime = temp; } break; case "ShowRate": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowRate = temp; } break; case "ShowSpots": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowSpots = temp; } break; case "ShowCost": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowCost = temp; } break; case "ShowTotalSpots": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowTotalSpots = temp; } break; case "ShowTotalCost": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowTotalCost = temp; } break; case "ShowAverageRate": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowAverageRate = temp; } break; case "ShowSpotsX": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) ShowSpotsX = temp; } break; case "UseDecimalRates": { bool temp; if (Boolean.TryParse(childNode.InnerText, out temp)) UseDecimalRates = temp; } break; case "PositionStation": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) PositionStation = temp; } break; case "PositionProgram": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) PositionProgram = temp; } break; case "PositionDay": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) PositionDay = temp; } break; case "PositionLenght": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) PositionLenght = temp; } break; case "PositionTime": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) PositionTime = temp; } break; case "PositionRate": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) PositionRate = temp; } break; case "PositionSpots": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) PositionSpots = temp; } break; case "PositionCost": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) PositionCost = temp; } break; case "SpotType": { int temp; if (Int32.TryParse(childNode.InnerText, out temp)) SpotType = (SpotType)temp; } break; case "Programs": foreach (XmlNode programNode in childNode.ChildNodes) { var program = new OptionProgram(); program.Deserialize(programNode); Programs.Add(program); } break; case "ContractSettings": ContractSettings.Deserialize(childNode); break; } }