//Method to be re written when serialisation/deserialisation implemented. public Game NewGame(Player newPlayer) { Game game = new Game(newPlayer); GameObject mayorSpawn = GameObject.Find("MayorSpawnLocation-Beach"); GameObject ethanSpawn = GameObject.Find("EthanSpawnLocation-Hut"); GameObject jennaSpawn = GameObject.Find("JennaSpawnPoint-forest"); GameObject fisherSpawn = GameObject.Find("FisherSpawnPoint-headland"); Npc mayor = new Npc("Mayor", "Mayor", mayorSpawn.transform.position, 1f, true); Npc ethan = new Npc("Ethan", "Ethan", ethanSpawn.transform.position, 0.2f, true); Npc jenna = new Npc("Jenna", "npc1", jennaSpawn.transform.position,0.3f, true); Npc fisher = new Npc("Fisher", "fisher", fisherSpawn.transform.position,0f, false); game.AddNpc(mayor); game.AddNpc(ethan); game.AddNpc(jenna); game.AddNpc(fisher); RecyclePoint beachPoint = new RecyclePoint("BeachRecyclePoint", 50); game.RecyclePoints.Add(beachPoint); game.CheckPoints.Add ("SpokenToMayorFirst"); game.CheckPoints.Add ("SpokenToEthan"); game.CheckPoints.Add ("FirstEthanMeetingPositive"); game.CheckPoints.Add ("MayorLeaveBeach"); game.CheckPoints.Add ("BeachRecyclePointFull"); game.CheckPoints.Add ("StartSortingMiniGame"); game.IsNewGame = false; return game; }
public RecyclePoint Copy() { RecyclePoint copy = new RecyclePoint (name, Capacity); foreach (InventoryItem item in recyclingItems) { copy.AddRubbishItem(item.GetCopy()); } return copy; }
public ActionResult <int> Post([FromBody] RecyclePoint recyclePoint) { db.RecyclePoints.Add(recyclePoint); db.SaveChanges(); return(db.RecyclePoints.Count()); }
public void AddRecyclePoint(RecyclePoint point) { var tmpPoint = _dbContext.RecyclePoints.Find(point); if (tmpPoint == null) { _dbContext.RecyclePoints.Add(point); _dbContext.SaveChanges(); } }
public RecyclePoint ModifityRecyclePoint(RecyclePoint point) { var oldPoint = _dbContext.RecyclePoints.Find(point); if (oldPoint != null) { _dbContext.RecyclePoints.Remove(point); _dbContext.RecyclePoints.Add(point); _dbContext.SaveChanges(); return(point); } return(null); }
private void InstantiateRecyclePoint(RecyclePoint point) { RecyclePointAdapter adapter = Array.Find (GameObject.FindObjectsOfType<RecyclePointAdapter> (), RPAdapter => RPAdapter.RecyclePointName == point.Name); if (adapter != null) { adapter.RecyclePoint = point; RecyclePointUI uiObserver = GameObject.FindObjectOfType<RecyclePointUI> (); point.AddObserver (uiObserver); } else { Debug.LogError("RecyclePointAdapter with name: " + point.Name + " not found"); } }
private static IEnumerable <PointCategoryRelationship> MappingCategory(IEnumerable <ICategory> categories, RecyclePoint point) { var relList = new List <PointCategoryRelationship>(); if (categories == null || !categories.Any()) { return(relList); } categories.AsParallel().ForAll(category => { relList.Add(new PointCategoryRelationship { RecyclePointId = point.Id, RecyclePoint = point, CategoryId = category.Id, Category = (CategoryEntity)category }); }); return(relList); }
public void HideUI() { mainBlock.SetActive(false); slotHolder.SetActive(false); ClearSlots(); currentPoint = null; }
public void ShowUI(RecyclePointAdapter adapter) { currentPoint = adapter.RecyclePoint; capacityText.text = Capacity.ToString(); foreach (InventoryItem item in currentPoint.RecyclingItems) { AddItem(item); } depositButton.onClick.AddListener(() => adapter.GetPlayerDeposit()); mainBlock.SetActive(true); slotHolder.SetActive(true); }