public void BuildBuilding(IBuilding building) { if (CanBuildBuilding(building.Size)) { _buildings.Add(building); } }
public void AddBuilding(IBuilding building) { if (building != null) { this.buildings.Add(building); } }
// ReSharper disable once TooManyDependencies public PersonGenerationService(ILogger <PersonGenerationService> logger, IBackgroundTaskQueue taskQueue, IBuilding building, ISettingsService settingsService) { _logger = logger; _taskQueue = taskQueue; _building = building; _settingsService = settingsService; }
Wall(ILevelManager level, IBuilding building) : base(level, building) { Vector3 topPosition = building.Center; topPosition = topPosition.WithY(GetHeightAt(topPosition.X, topPosition.Z).Value); pathNode = level.Map.PathFinding.CreateBuildingNode(building, topPosition, WallTag); }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionalSnowBehindParapet"/> class. /// </summary> /// <param name="building">Set instance of a class implementing <see cref="IBuilding"/> for <see cref="Building"/>.</param> /// <param name="width">Set <see cref="Width"/>.</param> /// <param name="heightDifference">Set <see cref="HeightDifference"/>.</param> public ExceptionalSnowBehindParapet(IBuilding building, double width, double heightDifference) { Building = building; Width = width; HeightDifference = heightDifference; SetReferences(); }
private void displayFloorInfo(IBuilding building) { labelFloorsInfo.Text = ""; foreach (IFloor floor in building.GetFloors()) { labelFloorsInfo.Text = labelFloorsInfo.Text + Environment.NewLine + "Floor Id : " + floor.FloorId.ToString(); } }
/// <summary> /// Initializes a new instance of the <see cref="SnowOverhanging"/> class. /// </summary> /// <param name="building">Set instance of a class implementing <see cref="IBuilding"/> for <see cref="Building"/>.</param> /// <param name="snowLayerDepth">Set <see cref="SnowLayerDepth"/>.</param> /// <param name="roof">Is used to calculate <see cref="SnowLoadOnRoofValue"/>.</param> public SnowOverhanging(IBuilding building, double snowLayerDepth, IMonopitchRoof roof) { Building = building; SnowLayerDepth = snowLayerDepth; roof.CalculateSnowLoad(); SnowLoadOnRoofValue = roof.SnowLoadOnRoofValue; }
public void update(Tile t) { // Update to show the details of the provided tile this.targetBuilding = this.gc.getBuilding(t); this.assignWorkerButton.tryTurnOn(targetBuilding); this.removeWorkerButton.tryTurnOn(targetBuilding); this.redraw(); }
public void AddBuilding(IBuilding building) { if (building == null) { throw new ArgumentNullException(nameof(building)); } this.buildings.Add(building); }
public void DeleteBuilding(IBuilding building) { RemoveBuilding (building); IWorkplace wp = building as IWorkplace; if (wp != null) { RemoveWorkplace(wp); } }
private void ExecuteBuildCommand(string[] commandArgs) { string name = commandArgs[1]; IBuilding building = this.buildingFactory.CreateBuilding(name); this.buildingData.Buildings.Add(building); }
public YieldSummary GetYieldOfBuildingSlotsForCity(IBuilding building, ICity city) { var multiplier = GetMultiplier(city); var slotYield = building.Template.Specialist.Yield * multiplier; return(slotYield); }
static void Main(string[] args) { FlatFromInterface flat = new FlatFromInterface(); IBuilding building = flat; IPlace place = flat; Console.ReadLine(); }
public void AddBuilding(IBuilding building) { if (building == null) { throw new ArgumentNullException("building"); //nameof(building) } this.buildings.Add(building); }
public YieldSummary GetYieldOfBuildingForCity(IBuilding building, ICity city) { var multiplier = GetMultiplier(city); var buildingYield = BuildingYieldLogic.GetYieldOfBuilding(building) * multiplier; return(buildingYield); }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionalOverDoorOrLoadingBay"/> class. /// </summary> /// <param name="building">Set instance of a class implementing <see cref="IBuilding"/> for <see cref="Building"/>.</param> /// <param name="widthAboveDoor">Set <see cref="WidthAboveDoor"/>.</param> /// <param name="buildingWidth">Set <see cref="BuildingWidth"/>.</param> /// <param name="heightDifference">Set <see cref="HeightDifference"/>.</param> public ExceptionalOverDoorOrLoadingBay(IBuilding building, double widthAboveDoor, double buildingWidth, double heightDifference) { Building = building; WidthAboveDoor = widthAboveDoor; BuildingWidth = buildingWidth; HeightDifference = heightDifference; SetReferences(); }
Gate(ILevelManager level, IBuilding building) : base(level, building) { this.leftDoor = new Door(building.Node.GetChild("Door_l"), 90, 180, 5, true); this.rightDoor = new Door(building.Node.GetChild("Door_r"), 90, 0, 5, true); this.roofNodes = new Dictionary <ITile, IBuildingNode>(); this.tunnelNodes = new Dictionary <ITile, IBuildingNode>(); }
public void MakeMoneyFromRealEstate() { IBuilding building = CreateBuilding(); building.SetPrice(); building.Advertise(); building.Sell(); }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionalMultiSpanRoof"/> class. /// </summary> /// <param name="building">Set instance of a class implementing <see cref="IBuilding"/> for <see cref="Building"/>.</param> /// <param name="leftDriftLength">Set <see cref="LeftDriftLength"/>.</param> /// <param name="rightDriftLength">Set <see cref="RightDriftLength"/>.</param> /// <param name="heightInTheLowestPart">Set <see cref="HeightInTheLowestPart"/>.</param> public ExceptionalMultiSpanRoof(IBuilding building, double leftDriftLength, double rightDriftLength, double heightInTheLowestPart) { Building = building; LeftDriftLength = leftDriftLength; RightDriftLength = rightDriftLength; HeightInTheLowestPart = heightInTheLowestPart; SetReferences(); }
public void addBuilding(IBuilding newBuilding) { // This simply draws the building onto the Building TileMap object Vector2Int pos = newBuilding.position(); updateIncomingCost(pos.x, pos.y, 150); // We can walk through buildings, but it'll cost 150 navigation cost tileDraw.drawBuilding(newBuilding); }
private void OnEnable() { m_building = UI_ScreenBuilding.GetCurrentBuilding(); /* * inputFood.text = m_building.data.foodPerDay.ToString(); * inputResearch.text = m_building.data.researchPerDay.ToString(); */ }
private IEnumerator waitForConstruction(IBuilding newBuilding) { // First, mark the target tile as occupied mapController.construction(newBuilding.position()); // Wait for the designated time yield return(new WaitForSeconds(newBuilding.timeToBuild() * GameSetup.TICK_LENGHT_SEC)); forceBuildBuilding(newBuilding); }
public static void CancelAllJobs(this IBuilding bldg) { var jobs = bldg.jobHandles.ToList(); foreach (var job in jobs) { job.CancelJob(); } }
public void GivenIHaveABuildingToEnterAt(double x, double y) { var mockPosition = new Mock <IPosition>(); mockPosition.SetupGet(p => p.Value).Returns(new System.Windows.Point(x, y)); var mockBuilding = new Mock <BasicBuildingBase>("Test Building", mockPosition.Object).SetupAllProperties(); building = mockBuilding.Object; }
public void AddBuilding(IBuilding building) { if (building == null) { throw new ArgumentNullException(nameof(building) + "Can`t add null building"); } buildings.Add(building); }
/// <summary> /// Initializes a new instance of the <see cref="CylindricalRoof"/> class. /// </summary> /// <param name="building">Set instance of a class implementing <see cref="IBuilding"/> for <see cref="Building"/>.</param> /// <param name="width">Set <see cref="Width"/> of the roof.</param> /// <param name="height">Set <see cref="Height"/> of the roof.</param> public CylindricalRoof(IBuilding building, double width, double height) { RoofCasesSnowLoad = new Dictionary <int, double>(); Building = building; Width = width > 0 ? width : throw new ArgumentOutOfRangeException(nameof(width)); Height = height > 0 ? height : throw new ArgumentOutOfRangeException(nameof(height)); SetReferences(); }
/// <summary> /// Initializes a new instance of the <see cref="MultiSpanRoof"/> class. /// </summary> /// <param name="building">Set instance of a class implementing <see cref="IBuilding"/> for <see cref="Building"/>.</param> /// <param name="leftRoof">Set instance of a class implementing <see cref="IMonopitchRoof"/> for <see cref="LeftRoof"/>.</param> /// <param name="rightRoof">Set instance of a class implementing <see cref="IMonopitchRoof"/> for <see cref="RightRoof"/>.</param> public MultiSpanRoof(IBuilding building, IMonopitchRoof leftRoof, IMonopitchRoof rightRoof) { Building = building; LeftRoof = leftRoof; RightRoof = rightRoof; SetReferences(); }
/// <summary> /// Initializes a new instance of the <see cref="CylindricalRoof"/> class. /// </summary> /// <param name="building">Set instance of a class implementing <see cref="IBuilding"/> for <see cref="Building"/>.</param> /// <param name="width">Set <see cref="Width"/> of the roof.</param> /// <param name="height">Set <see cref="Height"/> of the roof.</param> public CylindricalRoof(IBuilding building, double width, double height) { RoofCasesSnowLoad = new Dictionary <int, double>(); Building = building; Width = width; Height = height; SetReferences(); }
public virtual void BlockBuildingArea(IMap map, IBuilding building, IPoint placingPointOnMap) { foreach (var tilePattern in building.TilePatterns) //todo refactor with below { var buildingTilePoint = Transform(placingPointOnMap, tilePattern.Transformation, building.Angle); var tile = map[buildingTilePoint.X, buildingTilePoint.Y]; tile.IsTemporarilyBlocked = true; } }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionalSnowBehindParapetAtEaves"/> class. /// </summary> /// <param name="building">Set instance of a class implementing <see cref="IBuilding"/> for <see cref="Building"/>.</param> /// <param name="width">Set <see cref="Width"/>.</param> /// <param name="heightDifference">Set <see cref="HeightDifference"/>.</param> public ExceptionalSnowInValleyBehindParapet(IBuilding building, double width, double heightDifference) { Building = building; Width = width > 0 ? width : throw new ArgumentOutOfRangeException(nameof(width)); HeightDifference = heightDifference > 0 ? heightDifference : throw new ArgumentOutOfRangeException(nameof(heightDifference)); SetReferences(); }
/// <summary> /// Places the given <paramref name="building"/> /// in the <see cref="Building"/> slot. /// </summary> /// <param name="building">Building to place.</param> public void PlaceBuilding(IBuilding building) { if (Building != null) { throw new InvalidOperationException("Slot already occupied by a building"); } Building = building ?? throw new ArgumentNullException(nameof(building)); }
private void RightClick() { if (BasePlayer.player.isCurrently(Player.status.IDLE)) { //Do nothing } else if (BasePlayer.player.isCurrently(Player.status.SELECTED_UNITS)) { bool hasHit; RaycastHit hit = FindHit(out hasHit, Constants.Layers.HIT_MASK); if (!hasHit) // out of bounds click { Debug.Log("The click is out of bounds?"); } else { GameObject gameObject = hit.collider.gameObject; int hitLayer = (gameObject ? gameObject.layer : 0); if (hitLayer == Constants.Layers.TERRAIN) { // if resource is selected then we are setting the meeting point if (sManager.IsBuilding) { IBuilding building = sManager.SelectedBuilding; building.setMeetingPoint(hit.point); } else { sManager.MoveTo(hit.point); // if it is the terrain,and we are not building let's go there } } else if (hitLayer == Constants.Layers.UNIT || hitLayer == Constants.Layers.BUILDING) // let's find what it is, check if is own unit or rival { IGameEntity entity = gameObject.GetComponent <IGameEntity>(); if (entity.info.race != BasePlayer.player.race && entity.status != EntityStatus.DEAD && entity.status != EntityStatus.DESTROYED) { sManager.AttackTo(entity); } else if (entity.info.isResource && (entity.status == EntityStatus.IDLE || entity.status == EntityStatus.WORKING)) { sManager.Enter(entity); } } } } else if (BasePlayer.player.isCurrently(Player.status.PLACING_BUILDING)) { bManager.cancelPlacing(); BasePlayer.player.setCurrently(Player.status.SELECTED_UNITS); } }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionalObstructionOnFlatRoof"/> class. /// </summary> /// <param name="building">Set instance of a class implementing <see cref="IBuilding"/> for <see cref="Building"/>.</param> /// <param name="leftWidth">Set <see cref="LeftWidth"/>.</param> /// <param name="rightWidth">Set <see cref="RightWidth"/>.</param> /// <param name="leftHeightDifference">Set <see cref="LeftHeightDifference"/>.</param> /// <param name="rightHeightDifference">Set <see cref="RightHeightDifference"/>.</param> public ExceptionalObstructionOnFlatRoof(IBuilding building, double leftWidth, double rightWidth, double leftHeightDifference, double rightHeightDifference) { Building = building; LeftWidth = leftWidth; RightWidth = rightWidth; LeftHeightDifference = leftHeightDifference; RightHeightDifference = rightHeightDifference; SetReferences(); }
public void cleanAssignWorker(IBuilding building) { // Grabs a random Dwarf and tells them to walk to a building Dwarf d = this.freeWorkers.Dequeue(); // This coroutine will come calling back to us once the dwarf is in position StartCoroutine(d.assignWork(building, forceAssignWorker)); resourceDisplay.workerAssigned(); }
public void startBuildBuilding(IBuilding newBuilding) { // Spend the cash money // NOTE: validation is done at button click time gameState.spendForBuilding(newBuilding); // Start the construction process of this new building StartCoroutine(waitForConstruction(newBuilding)); }
public BuildingViewModel(int level, IBuilding res) { this.Level = level; this.Name = res.Name; this.Description = res.Description; this.MaxLevel = res.MaxLevel; this.Prerequisite = res.Prerequisite; this.RequiredBuildTime = this.Level < this.MaxLevel ? res.BuildTime[this.Level + 1].TotalMinutes : 0; var requiredResources = res.GetRequiredResources(this.Level + 1); this.RequiredEnergy = requiredResources[0]; this.RequiredCrystals = requiredResources[1]; this.RequiredMetal = requiredResources[2]; }
public void AddBuilding(IBuilding building) { this.Building = building; }
public GameObject SpawnAtPos(GameObject Pref, Vector2 Pos,IBuilding b) { GameObject Button = GameObject.Instantiate(Pref, new Vector3(-20, 0, 0), Quaternion.identity) as GameObject; Button.transform.parent = BuildingItems.transform; Button.GetComponent<BuildingItemButtonView>().Init(b); RectTransform rct = Button.GetComponent<RectTransform>(); rct.DOAnchorPos(Pos, 0.5f); return Button; }
public void AddBuilding(IBuilding buildingToBeAdded) { this.buildings.Add(buildingToBeAdded); }
public void RegistrationBuilding(IBuilding building) { AddBuilding(building); IWorkplace wp = building as IWorkplace; if (wp != null){ AddWorkplace(wp); } }
public void OnButtonClick(IBuilding b) { Debug.Log(b.Name); }
private void AddBuilding(IBuilding pBuilding) { buildings.Add(pBuilding); }
public void ApplyBuildingRules(IBuilding b) { if(b.Name == "Castle") { GameRule.CastleCount++; } GameRule.BuildingCount++; }
public bool PlaceBuilding(IBuilding b) { int x = b.Tile.X; int z = b.Tile.Z; int tileCounter = 2; //2x2 minimum switch (b.Type) { case BuildingType.OneByOne: tileCounter = 1; break; case BuildingType.TwoByTwo: tileCounter = 2; break; case BuildingType.ThreeByThree: tileCounter = 3; break; case BuildingType.FourByFour: tileCounter = 5; break; } bool bTest = Check(x, z, tileCounter); if (!bTest) { SetTile(x, z, tileCounter); PlaceBuildingCommand.Dispatch(FindGo(x,z).transform.position,b); m_CurrentBuildingsOnGrid.Add(new KeyValuePair<IBuilding, GameObject>(b, GridBuildings.Last())); for (int i = 0; i < b.ResourceList.Count(); i++) { IResource r = b.ResourceList.ElementAt(i); ResourceSystem.AddTicker(r); } OutputGrid(m_Grid); ApplyBuildingRules(b); } return !bTest; }
public void Execute(IBuilding b, IBuildingFunction f) { }
public void Remove(IBuilding b) { IBuildingFunction f = m_Functions.Where(x => x.Value == b).FirstOrDefault().Key; GameObject Go = m_Queue.Where(x => x.Value == b).FirstOrDefault().Key; ITimer t = m_Timers.Where(x => x.Key == Go).FirstOrDefault().Value; m_BuildingTimers.RemoveAll(x => x.Key == b && x.Value == t); m_Functions.RemoveAll(x => x.Key == f && x.Value == b); m_Timers.Remove(m_Timers.Where(x => x.Value == t).FirstOrDefault()); UnityEngine.Object.Destroy(Go); m_Queue.RemoveAll(x => x.Key == Go); GameObject Pref = m_ConstructionPrefabList.Where(x => x.Key == b).FirstOrDefault().Value; UnityEngine.Object.Destroy(Pref); m_ConstructionPrefabList.RemoveAll(x => x.Key == b); UpdatePositions(); switch(f.Type) { case FuncType.Construction: Grid.PlaceBuilding(b); break; case FuncType.Upgrade: Grid.PlaceBuilding(b); break; case FuncType.Destruction: break; } f.Effect.Execute(b, f); }
public void Execute(IBuilding b, IBuildingFunction f) { b.Upgrade(); }
public void AddConstructionPrefab(IBuilding b,IBuildingFunction f) { GameObject Pref = BuildingModels.Where(x => x.name == "Construction").FirstOrDefault(); Vector3 Pos = Vector3.zero; GameObject GridTile = Grid.FindGo(b.Tile.X, b.Tile.Z); Pos = GridTile.transform.position; Pos.y += 0.5f; GameObject Inst = GameObject.Instantiate(Pref, Pos, Pref.transform.rotation) as GameObject; m_ConstructionPrefabList.Add(new KeyValuePair<IBuilding, GameObject>(b, Inst)); }
public bool DoSelectBuildingToBuild(IBuilding building, bool isHasPrivilage) { if (building == null) { return true; } var buildingToBuild = _mainBoardController.Status.Buildings.Single(x => x.Key.GetType() == building.GetType()); var totalDiscount = _playerStatus.Board.Quarries.Count(x => x.CurrentColonistsCount > 0); var realCost = buildingToBuild.Key.Cost - totalDiscount - (isHasPrivilage ? 1 : 0); if (buildingToBuild.Value > 0 && realCost <= _playerStatus.Doubloons && _playerStatus.Board.CanBuildBuilding(buildingToBuild.Key.Size)) { _playerStatus.Board.BuildBuilding(buildingToBuild.Key); _mainBoardController.Status.Buildings[buildingToBuild.Key]--; _mainBoardController.ReceiveDoubloons(_playerStatus.PayDoubloons(realCost)); var param = new BuilderParameters(); _playerStatus.Board.Buildings.OfType<BuildingBase<BuilderParameters>>() .Where(x => x.IsActive) .ToList() .ForEach(x => x.DoAction(ref param)); if (param.TakeAdditionalColonist) { _mainBoardController.Status.Colonists.Move(buildingToBuild.Key); } return true; } return false; }
private bool CanBuild(PlayerObject pO, int toLevel, IBuilding buildingLogic) { if (pO.Buildings.CurrentlyBuilding != CurrentlyBuilding.None) { return false; } if (toLevel > buildingLogic.MaxLevel) { return false; } if (pO.Buildings.HeadQuartersLevel < buildingLogic.Prerequisite) { return false; } if (toLevel > pO.Buildings.HeadQuartersLevel && buildingLogic.Name != "Headquarters") { return false; } var requiredResources = buildingLogic.GetRequiredResources(toLevel); return pO.Resources.Energy > requiredResources[0] && pO.Resources.Crystal > requiredResources[1] && pO.Resources.Metal > requiredResources[2]; }
public void AddBuilding(IBuilding building) { this.buildings.Add(building); }
private void Start() { base.Init(); _buildingBehaviour = GetComponent<IBuilding>(); _buildingModel = transform.FindChild("Model").gameObject; if(_buildingBehaviour != null) OnBuild += _buildingBehaviour.OnBuild; }
public void Init(IBuilding b) { m_Building = b; }
public void Init(IBuilding b) { BuildingData = b; }
private void RemoveBuilding(IBuilding pBuilding) { buildings.Remove(pBuilding); }
public Engine(IBuilding iBuilding, IInput iInput, IOutput iOutput) { this.iBuilding = iBuilding; this.iInput = iInput; this.iOutput = iOutput; }