public void CreateCityManagerAndPopulateWithCitiesTest() { // Cities we want managed City.City city1 = new City.City(500000); City.City city2 = new City.City(2500000); City.City city3 = new City.City(40000); Assert.IsNotNull(city1); Assert.IsNotNull(city2); Assert.IsNotNull(city3); // Add them to city manager CityManager cityManager = new CityManager(); // List of cities should be instantiated when a citymanager is created Assert.IsNotNull(cityManager); Assert.IsNotNull(cityManager.Cities); cityManager.Add(city1); cityManager.Add(city2); cityManager.Add(city3); Assert.AreEqual(3, cityManager.Cities.Count, "City Manager did not add cities correctly"); Assert.AreEqual(city1, cityManager.Cities[0], "Incorrect city was added to city manager"); Assert.AreEqual(city2, cityManager.Cities[1], "Incorrect city was added to city manager"); Assert.AreEqual(city3, cityManager.Cities[2], "Incorrect city was added to city manager"); }
public void DeselectEverything() { hexGrid.DeselectAllCells(); unitManager.DeselectAllUnits(); terrainPanel.SetActive(false); if (currentSelectedCell != null) { currentSelectedCell.DeselectCell(); currentSelectedCell = null; } if (currentSelectedCity != null) { currentSelectedCity.DeselectCity(); currentSelectedCity = null; } if (currentSelectedUnit != null) { currentSelectedUnit.DeselectUnit(); currentSelectedUnit = null; } civManager.UnselectAllCities(); hexCamera.UnsetGameObjectToFollow(); }
private void CreateCity(int nameId) { _city = Game.AddCity(_player, nameId, _x, _y); if (_city != null) { if (_player.IsHuman) { // TODO fire-eggs not showing may lose side-effects //if (!Game.Animations) { CityView cityView = new CityView(_city, founded: true); cityView.Closed += CityFounded; cityView.Skipped += CityViewed; Common.AddScreen(cityView); return; } { CityManager cityManager = new CityManager(_city); cityManager.Closed += CityManagerClosed; Common.AddScreen(cityManager); return; } } if (_unit != null) { Game.DisbandUnit(_unit); } } Game.UpdateResources(_city.Tile); EndTask(); }
public void return_to_game() { CityManager.update_total_people(0); PauseManager.pause_game(false); GameObject.Find("GameManager").GetComponent <BoxCollider2D>().enabled = true; activate_default_handler(); }
public GoodsInformationList() { this.cityManager = new CityManager(); this.statistic = new Statistic(); this.totalGoods = this.statistic.TotalGoods; this.totalLorry = this.statistic.TotalLorry; }
private void HandleMouseMove(MoisManager input) { Ray mouseRay = GetSelectionRay(input.MousePosX, input.MousePosY); Mogre.Pair <bool, float> intersection = mouseRay.Intersects(new Plane(Vector3.UNIT_Y, Vector3.ZERO)); if (intersection.first && selboxShouldUpate()) { Vector3 intersectionPt = mouseRay.Origin + mouseRay.Direction * intersection.second; Point plotCoord = CityManager.GetPlotCoords(intersectionPt); Vector3 plotCenter = CityManager.GetPlotCenter(plotCoord); cursorPlane.SetPosition(plotCenter.x, plotCenter.y + 1f, plotCenter.z); if (mouseMode == MouseMode.PlacingBuilding && tempBuilding != null) { tempBuilding.SetPosition(plotCoord.X, plotCoord.Y); } DebugPanel.SetDebugText(CityManager.GetPlotCoords(intersectionPt).ToString()); } if (input.MouseMoveZ != 0.0f) { dist += input.MouseMoveZ * 0.002f; if (dist < -14.0f) { dist = -14.0f; } if (dist > 0.0f) { dist = 0.0f; } } }
public bool remove_last_room() { if (last_room_position_stack.Count == 0) { return(false); } Vector2Int room_pos = (Vector2Int)last_room_position_stack.Pop(); Room boarded_room = city.city_room_matrix[room_pos.x, room_pos.y]; city.city_room_matrix[room_pos.x, room_pos.y] = null; if (boarded_room.has_person) { GameObject person_go = boarded_room.person_go_instance; Person person = person_go.GetComponent <Person>(); if (person.desired_activity != "") // not in a period of waiting for activity { PersonManager.add_notification_for_city(person.city.tilemap_position, false); // remove notification } string review_summary = "I'll go somewhere that can stick to the train schedule."; person.leave_review(person.city, Person.Review.One_Star); person.update_review_page(review_summary, (int)Person.Review.One_Star); DestroyImmediate(person_go); // otherwise get error from coroutine CityManager.update_total_people(-1); } else if (boarded_room.booked)// person has not arrived yet, but the room is booked. Don't remove this room. { return(false); } DestroyImmediate(boarded_room.inner_door_container); DestroyImmediate(boarded_room.outer_door_container); roomba[boarded_room.id] = null; city.city_tilemap.SetTile((Vector3Int)room_pos, city.boarded_up_tile); current_capacity -= 1; return(true); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { CityManager obj = new CityManager(); City[] cityList = obj.GetCities(); dpFromCity.Items.Add("None"); foreach (City c in cityList) { ListItem item = new ListItem(c.Name, c.CityId.ToString()); dpFromCity.Items.Add(item); } dpFromCity.DataBind(); dpToCity.Items.Add("None"); foreach (City c in cityList) { ListItem item = new ListItem(c.Name, c.CityId.ToString()); dpToCity.Items.Add(item); } dpToCity.DataBind(); } catch (CityManagerException ex) { lblError.Text = ex.Message; } } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (!Page.IsValid) { return; } bool Updating = false; City oCity = null; if (CityID > 0) { oCity = CityManager.GetCityByID(CityID); Updating = oCity != null; } if (!Updating) { oCity = new City(); } oCity.CountryID = this.ddlCountryID.SelectedValue.ToInt(); oCity.CityName = this.txtCityName.Text; oCity.Status = this.chkStatus.Checked; bool bSuccess = Updating ? CityManager.UpdateCity(oCity) : CityManager.InsertCity(oCity); if (bSuccess) { Redirect("/city-list?s=1"); } else { base.Warn("error.save"); } }
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { CityManager cityManager = new CityManager(); GridView1.DataSource = cityManager; GridView1.DataBind(); }
private void modifyToolStripMenuItem_Click(object sender, EventArgs e) { try { if (lvwCities.SelectedItems != null && lvwCities.SelectedItems.Count != 0) { if (IsList) { btnOk_Click(sender, e); } else { if (objUIRights.ModifyRight) { City objCity; frmCityProp objFrmProp; objCity = CityManager.GetItem(Convert.ToInt32(lvwCities.SelectedItems[0].Name)); objFrmProp = new frmCityProp(objCity, objCurUser); objFrmProp.MdiParent = this.MdiParent; objFrmProp.Entry_DataChanged += new frmCityProp.CityUpdateHandler(Entry_DataChanged); objFrmProp.Show(); } else { throw new Exception("Not Authorised."); } } } } catch (Exception ex) { MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public void mark_exit_track() { bool north_exit_visible = CityManager.is_exit_route_shown(RouteManager.Orientation.North); bool east_exit_visible = CityManager.is_exit_route_shown(RouteManager.Orientation.East); bool west_exit_visible = CityManager.is_exit_route_shown(RouteManager.Orientation.West); bool south_exit_visible = CityManager.is_exit_route_shown(RouteManager.Orientation.South); List <List <int[]> > train_action_coord = new List <List <int[]> >(); List <string> train_hint_list = new List <string>(); if (north_exit_visible) { train_hint_list.Add("north exit"); train_action_coord.Add(TrackManager.exit_track_map[RouteManager.Orientation.North]); } if (east_exit_visible) { train_hint_list.Add("east exit"); train_action_coord.Add(TrackManager.exit_track_map[RouteManager.Orientation.East]); } if (west_exit_visible) { train_action_coord.Add(TrackManager.exit_track_map[RouteManager.Orientation.West]); train_hint_list.Add("west exit"); } if (south_exit_visible) { train_action_coord.Add(TrackManager.exit_track_map[RouteManager.Orientation.South]); train_hint_list.Add("south exit"); } game_manager.mark_tile_as_eligible(train_action_coord, train_hint_list, gameObject, true); }
//Vue complexe utilisant le modèle OrderDetailsViewModel //Permet d'afficher le nom du restaurant de la commande, le numéro de la commande, les plats choisis (bug, 1 seul plat est affiché), //la quantité par plats, le prix unitaire d'un plat, l'heure de livraison... public ActionResult OrderDetails() { List <OrderDetailsViewModel> listeOrderDetails = new List <OrderDetailsViewModel>(); OrderDetailsViewModel orderDetails = new OrderDetailsViewModel(); int idCustomer = HttpContext.Session.GetInt32("IdCustomer").GetValueOrDefault(); int idOrder = HttpContext.Session.GetInt32("IdOrder").GetValueOrDefault(); int idRestaurant = HttpContext.Session.GetInt32("IdRestaurant").GetValueOrDefault(); int idDeliveryTime = HttpContext.Session.GetInt32("Id_Delivery_time").GetValueOrDefault(); OrderManager.UpdateOrderDeliveryTime(idOrder, idDeliveryTime); List <DTO.Order_Dish> listeOrder_Dishes = Order_DishManager.GetAllOrder_Dish(idOrder); DTO.Customer customer = CustomerManager.GetCustomer(idCustomer); DTO.Order order = OrderManager.GetOrder(idOrder); DTO.Restaurant restaurant = RestaurantManager.GetRestaurant(idRestaurant); orderDetails.Customers = customer; orderDetails.Orders = order; orderDetails.Restaurants = restaurant; orderDetails.Cities = CityManager.GetCity(customer.FK_idCity); orderDetails.Delivery_Times = Delivery_TimeManager.GetDelivery_Time(idDeliveryTime); foreach (DTO.Order_Dish od in listeOrder_Dishes) { orderDetails.Order_Dishes = od; orderDetails.Dishes = DishManager.GetDish(od.FK_idDish); } listeOrderDetails.Add(orderDetails); return(View(listeOrderDetails)); }
public ActionResult Edit(int id) { var model = CustomerManager.Get(id); ViewBag.allCities = CityManager.GetAllEntities().OrderBy(c => c.Naziv); return(View(model)); }
public virtual void Awake() { player = GameObject.FindGameObjectWithTag("Player"); attackSound = GetComponent<AudioSource>(); enemyRigidBody = GetComponent<Rigidbody>(); theCity = GameObject.FindGameObjectWithTag("City").GetComponent<CityManager>(); }
public DepotInfoList() { this.cityManager = new CityManager(); this.statistic = new Statistic(); this.totalGoods = this.statistic.TotalGoods; this.totalLorry = this.statistic.TotalLorry; }
public static object GetCities(DataTableAjaxPostModel model) { var cols = new List <string>() { "LOWER(TRIM(cm.city_name))", "LOWER(TRIM(sm.state_name))", "LOWER(TRIM(cm.doc_count))" }; // Initialization. DataTableData <CityModel> result = new DataTableData <CityModel>(); try { // Initialization. string draw = model.draw.ToString(); int startRec = model.start; int pageSize = model.length; var c_order = ""; foreach (var o in model.order) { var columnName = cols[o.column]; c_order += string.IsNullOrWhiteSpace(c_order) ? columnName + " " + o.dir : ", " + columnName + " " + o.dir; } if (!string.IsNullOrWhiteSpace(c_order)) { c_order = " order by " + c_order; } var c_search = ""; foreach (var s in model.columns) { if (!string.IsNullOrWhiteSpace(s.search.value) && s.searchable) { var i = model.columns.IndexOf(s); var columnName = cols[i]; c_search += i == 1 ? " and " + columnName + " like '%" + s.search.value.Trim().ToLower() + "%'" : " and " + columnName + " like '%" + s.search.value + "%'"; } } var cities = new CityManager().GetAllCitiesPaginated(startRec, pageSize, c_order, c_search); var cityList = cities.Data; foreach (var city in cityList) { city.Link = "<a href='javascript:void(0);' style='margin-right:10px' class='edit-city' data-id='" + city.Id + "'>Edit</a><a href='javascript:void(0);' style='margin-left:10px' class='delete-city' data-id='" + city.Id + "'>Delete</a>"; } int recFilter = cities.Data.Count; result.draw = Convert.ToInt32(draw); result.recordsTotal = cities.TotalCount; result.recordsFiltered = cities.TotalCount; result.data = cityList; } catch (Exception ex) { // Info Console.Write(ex); } // Return info. return(result); }
private void LoadCity() { List <City> city = CityManager.GetAll(); CityGridView.DataSource = city; CityGridView.DataBind(); }
private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { try { if (lvwCities.SelectedItems != null && lvwCities.SelectedItems.Count != 0) { if (!IsList) { if (objUIRights.DeleteRight) { DialogResult dr = new DialogResult(); dr = MessageBox.Show("Do You Really Want to Delete Record ?", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (dr == DialogResult.Yes) { City objCity = new City(); objCity = CityManager.GetItem(Convert.ToInt32(lvwCities.SelectedItems[0].Name)); CityManager.Delete(objCity); lvwCities.Items.Remove(lvwCities.SelectedItems[0]); } } else { throw new Exception("Not Authorised."); } } } } catch (Exception ex) { MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void InitializeData() { DateTime fiveDaysLater = new DateTime(); DateTime now = new DateTime(); now = fiveDaysLater = DateTime.Now; fiveDaysLater = fiveDaysLater.AddDays(5); WeatherManager weatherManager = new WeatherManager(new WeatherDataContext()); CityManager cityManager = new CityManager(new WeatherDataContext()); var cities = cityManager.GetObservedCities(); Dictionary <string, List <ForecastEntity> > entities = new Dictionary <string, List <ForecastEntity> >(); foreach (var city in cities) { entities.Add(city.Name, weatherManager.GetForecasts(city, now, fiveDaysLater)); } var labels = new List <string>(); MinTemperatures = new ChartValues <double>(); MaxTemperatures = new ChartValues <double>(); foreach (var entity in entities) { MinTemperatures.Add(entity.Value.Min(x => x.WeatherMain.TemperatureMin)); MaxTemperatures.Add(entity.Value.Max(x => x.WeatherMain.TemperatureMax)); labels.Add(entity.Key); } Cities = labels.ToArray(); }
static void Main(string[] args) { var cityDbManager = new CityManager(Configuration); // Méthode qui montre toutes les cities présentes dans la BD Console.WriteLine("--GET ALL CITIES--"); var cities = cityDbManager.GetAllCities(); foreach (var city in cities) { Console.WriteLine(city.ToString()); Console.WriteLine("Tip top"); } /* * //Add City * Console.WriteLine("--NEW CITY--"); * var newCity = cityDbManager.AddCity(new City { Name = "Monthey"}); * Console.WriteLine($"ID : {newCity.IdCity} Name : {newCity.Name}"); * cities = cityDbManager.GetAllCities(); * foreach (var city in cities) * { * Console.WriteLine($"ID : {city.IdCity} Name : {city.Name}"); * } */ }
/// <summary> /// Calculate bonus points based on cards built on current/left/right cities. /// </summary> /// <param name="bonusCard">The card giving the bonus.</param> /// <param name="leftCity">The left player's city.</param> /// <param name="rightCity">The right player's city.</param> /// <returns>The amount of points earned.</returns> public int CalculateCardBonus(BonusCard bonusCard, CityManager leftCity, CityManager rightCity) { List <Card> cardsToCheck = new List <Card>(); int bonusPoints = 0; if (bonusCard.CheckSelf) { cardsToCheck.AddRange(this.GetAllBuildings(bonusCard.BonusCardType)); } if (bonusCard.CheckLeft) { cardsToCheck.AddRange(leftCity.GetAllBuildings(bonusCard.BonusCardType)); } if (bonusCard.CheckRight) { cardsToCheck.AddRange(rightCity.GetAllBuildings(bonusCard.BonusCardType)); } foreach (Card c in cardsToCheck) { foreach (Card.CardType bonusType in bonusCard.BonusCardType) { bonusPoints += GetBonusPoints(bonusType, c, bonusCard); } } return(bonusPoints); }
// Start is called before the first frame update void Awake() { //numberPlayers = PlayerPrefs.GetInt("NumberPlayers"); isThereAI = PlayerPrefs.GetInt("IAPlayer") > 0; turnsToPlay = PlayerPrefs.GetInt("Turns"); numberPlayers = 2; players = new Player[numberPlayers]; initialPositions = new Tuple <int, int> [numberPlayers]; initialPositions[0] = new Tuple <int, int>(0, 0); //initialPositions[1] = new Tuple<int, int>(gridCreator.Width - 2, gridCreator.Height - 2); //initialPositions[1] = new Tuple<int, int>(gridCreator.Width - 1, gridCreator.Height - 2); initialPositions[1] = new Tuple <int, int>(9, 9); //initialPositions[1] = new Tuple<int, int>(1, 1); gridCreator.CreateGrid(); for (int i = 0; i < numberPlayers; ++i) { UnitManager unitManager = Instantiate(Resources.Load("UnitManager", typeof(UnitManager))) as UnitManager; unitManager.PlayerID = i; CityManager cityManager = Instantiate(Resources.Load("CityManager", typeof(CityManager))) as CityManager; cityManager.PlayerID = i; TechnologyManager technologyManager = new TechnologyManager(); players[i] = new Player(unitManager, cityManager, technologyManager); players[i].SetGrid(gridCreator.HexGrid); players[i].InstantiateInitialUnits(initialPositions[i]); } //unitManager.InstantiateIntialUnits(); scoreManager = new ScoreManager(players); //scoreEvent.AddListener(scoreManager.OnScoreEvent); if (IsThereAI) { aiPlayer = new AIPlayer(players[1], this, unitStats); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { //CSPRBUG18.1 - Implementing Custom Collection //Cities - Custom Collection also Sorted with needed Interfaces CityManager obj = new CityManager(); Cities cities = obj.GetSortedCities(); //CSPRBUG18.1 - Iterating through the Custom Collection dpFromCity.Items.Add("None"); foreach (City c in cities) { ListItem item = new ListItem(c.Name, c.CityId.ToString()); dpFromCity.Items.Add(item); } dpFromCity.DataBind(); //CSPRBUG18.1 - Iterating through the Custom Collection dpToCity.Items.Add("None"); foreach (City c in cities) { ListItem item = new ListItem(c.Name, c.CityId.ToString()); dpToCity.Items.Add(item); } dpToCity.DataBind(); } catch (CityManagerException ex) { lblError.Text = ex.Message; } } }
public void GetAll_AllCitiesCanListed() { ICityService cityService = new CityManager(_mockCityDal.Object); List <City> cities = cityService.GetAll().Data; Assert.AreEqual(3, cities.Count); }
private void FillData() { if (!String.IsNullOrEmpty(queryStringIdStr)) { CityManager _CityManager = new CityManager(); var obj = _CityManager.GetCity(queryStringId); if (obj != null) { txtCity.Text = obj.Name; if (obj.StateId.HasValue) { ddlState.Items.FindByValue(obj.StateId.Value.ToString()).Selected = true; } Operation = (String)GetGlobalResourceObject("HCMResource", "UpdateExisting"); } else { Operation = (String)GetGlobalResourceObject("HCMResource", "AddNew"); } } else { Operation = (String)GetGlobalResourceObject("HCMResource", "AddNew"); } }
private void HandleLeftMouseReleased(MoisManager input) { if (mouseMode == MouseMode.Selection && CityManager.SelectionIsValid()) { Mogre.Pair <bool, Point> result = getPlotCoordsFromScreenPoint(MousePosition(input)); if (result.first) { CityManager.UpdateSelectionBox(result.second); } UpdateSelectionBox(); CityManager.MakeSelection(); CityManager.ClearSelection(); selectionBox.SetVisible(false); } if ((canZone() || canUnzone()) && CityManager.ScratchZoneIsValid()) { Mogre.Pair <bool, Point> result = getPlotCoordsFromScreenPoint(MousePosition(input)); if (result.first) { CityManager.UpdateScratchZoneBox(result.second); } UpdateScratchZoneBox(); CityManager.MakeZone(); CityManager.ClearScratchZone(); scratchZone.SetVisible(false); } }
/// <summary> /// Start up the state /// </summary> /// <param name="_mgr">State manager for this state</param> /// <returns></returns> public override bool Startup(StateManager _mgr) { // store reference to the state manager StateMgr = _mgr; // get reference to the ogre manager OgreManager engine = StateMgr.Engine; //Instantiate everything WeatherMgr = new WeatherManager(); CityManager.SetGameMgr(this); //Initialize everythings createScene(engine); createUI(); createCommands(); //Initialize the City Manager (that's everything right?) CityManager.Init(0, 0); CompositorManager.Singleton.AddCompositor(engine.Window.GetViewport(0), "Bloom"); CompositorManager.Singleton.AddCompositor(engine.Window.GetViewport(0), "Radial Blur"); // OK return(true); }
/// <summary> /// Purpose of this method is to obtain valid /// user data for number of cities with associated /// population and maximum number of clinics /// </summary> public void UserInputNumberOfCities() { // Number of cities Console.WriteLine("Enter the number of cities: "); string inputNumberOfCities = Console.ReadLine(); int numberOfCities; bool isNumberOfCitiesValid = int.TryParse(inputNumberOfCities, out numberOfCities); numOfCities = numberOfCities; if (isNumberOfCitiesValid) { // Build each city and map to a population CityManager cityManager = BuildPopulationOfCities(numberOfCities); // Number of max clinics int numberOfClinics = UserInputNumberOfClinics(); // Now for the heavy lifting var maxPopulationPerClinic = DistributeClinicsOverCities(cityManager, numberOfClinics); Console.WriteLine("The maximum number of people each immunization clinic can hold is: " + maxPopulationPerClinic); Console.WriteLine("Press any key to continue..."); Console.ReadLine(); } else { Console.WriteLine("Number of cities must be an integer only!"); } }
private void Start() { NextTurnModal = ModalPanelObj.GetComponent <NextTurnModal>(); PopupText = PopupPanelObj.GetComponent <PopupText>(); BuildingManager = BuildingMangerObj.GetComponent <BuildingManager>(); CityManager = CityManagerObj.GetComponent <CityManager>(); GuiManager = GuiManagerObj.GetComponent <GuiManager>(); GameEventManager = GameEventManagerObj.GetComponent <GameEventManager>(); MissionManager = MissionManagerObj.GetComponent <MissionManager>(); GridManager = GridManagerObj.GetComponent <GridManager>(); Time = TimeObject; Text = TextObject; Expiry = ExpiryObject; TransitionAnimationPanel = _transitionAnimationPanel; Camera = _camera; foreach (var g in GoodsObjects) { if (g == null) { continue; } var e = (Good)Enum.Parse(typeof(Good), g.name); Goods.Add(e, g); } }
static void Main(string[] args) { var restaurantsManager = new RestaurantManager(Configuration); var restaurants = restaurantsManager.GetRestaurants(); foreach (var restaurant in restaurants) { Console.WriteLine(restaurant.ToString()); } var cityManager = new CityManager(Configuration); var cities = cityManager.GetCities(); foreach (var city in cities) { Console.WriteLine(city.ToString()); } var orderManager = new OrderManager(Configuration); var order = orderManager.GetOrder(14); double chiffre = (order.ShippingDate.TimeOfDay.TotalMinutes - DateTime.Now.TimeOfDay.TotalMinutes); Console.WriteLine(chiffre); }
void Awake() { stuckTimerCount = 0; city = GameObject.FindObjectOfType<CityManager>(); controller = GetComponent<CarController> (); player = GameObject.FindGameObjectWithTag("Player").transform; GetComponentInChildren<UnityStandardAssets.Vehicles.Car.CarAIControl>().SetTarget(player); }
protected CallDriverModel CreateCallDriverModel(string userName) { CallDriverModel cdm = new CallDriverModel(); CityManager cm = new CityManager(); List<Street> streets = cm.GetStreets(); cdm.Name = userName ?? string.Empty; cdm.StreetList = streets.Select(s => new SelectListItem { Text = s.Name , Value = s.Id.ToString() }).ToList(); return cdm; }
private void UpdateManagers() { cityManager = this.gameObject.GetComponent<CityManager>(); environmentManager = this.gameObject.GetComponent<EnvironmentManager>(); financeManager = this.gameObject.GetComponent<FinanceManager>(); legislationManager = this.gameObject.GetComponent<LegislationManager>(); popularityManager = this.gameObject.GetComponent<PopularityManager>(); powerPlantManager = this.gameObject.GetComponent<PowerPlantManager>(); researchDevelopmentManager = this.gameObject.GetComponent<ResearchDevelopmentManager>(); resourceManager = this.gameObject.GetComponent<ResourceManager>(); management = true; ++count; }
public string addToQueue(int driverId , int regionId) { //Clients.All.hello(data); DriverManager dm = new DriverManager(); CityManager cm = new CityManager(); Region region = cm.GetRegionsById(regionId); Driver driver = dm.GetById(driverId); DriverWorkModel driver_wm = new DriverWorkModel(driver, Status.Online, region); driver_wm.SignalR_id = Context.ConnectionId; QueueController queueController = new QueueController(); if (!queueController.HasSuchDriver(driver_wm)) { queueController.AddToQueue(driver_wm); Groups.Add(driver_wm.SignalR_id, "Drivers"); return "queue count:" + queueController.GetConunt(); } return "this driver is alredy added in queue"; }
// Use this for initialization public override void Start() { Instance = this; theCity = GameObject.FindGameObjectWithTag("City").GetComponent<CityManager>(); player = GameObject.FindGameObjectWithTag("Player"); kaiju = player.GetComponent<Kaiju>(); cityWidth = theCity.getWidth(); float x = theCity.gameObject.transform.position.x; if (x < 1) { // just incase this is 0 and messes with the math. x = 1; } float z = theCity.gameObject.transform.position.z; if (z < 1) { // just incase this is 0 and messes with the math. z = 1; } //X of City * width in tiles * width of tiles. cityBoundary.x = x + theCity.getWidth() * 2; cityBoundary.z = z + theCity.getDepth() * 2; StartCoroutine("Spawn"); base.Start(); }
// Use this for initialization void Awake() { instance = this; city = new List<CityCube[]>(); level = new byte[width]; ll = new Vector3(-width / 2f + 0.5f, -height / 2f + 0.5f); BuildCity(); }
// Use this for initialization void Start() { _cityManager = new CityManager(); }
public static List<SelectListItem> GetStreets() { CityManager cm = new CityManager(); List<Street> streets = cm.GetStreets(); return streets.Select(s => new SelectListItem { Text = s.Name, Value = s.Name.ToString() }).ToList(); }
// Use this for initialization void Start () { instance = this; cityFlags = new bool[]{false, false, false}; }