public static void NotifyAll(GoalItem item) { foreach (AbstractGoal goal in singleton.goals) { if (goal.Type == item.type) { goal.Notify(item); } } }
public bool CreateGoalItem(GoalItemCreate model) { var entity = new GoalItem() { UserID = _userID, GoalItemName = model.GoalItemName, GoalItemPrice = model.GoalItemPrice, GoalItemLocation = model.GoalItemLocation, CreatedUTC = DateTimeOffset.Now }; using (var ctx = new ApplicationDbContext()) { ctx.GoalItems.Add(entity); return(ctx.SaveChanges() == 1); } }
public ActionResult CreateGoalItem(GoalItem goalItem) { try { var userId = this.User.FindFirstValue(ClaimTypes.NameIdentifier); var budgeteer = _repo.Budgeteers.GetBudgeteerByUserId(userId); var newGoalItem = new GoalItem { GoalItemName = goalItem.GoalItemName, Category = goalItem.Category, Amount = goalItem.Amount, BudgeteerId = budgeteer.BudgeteerId }; _repo.GoalItems.Create(newGoalItem); _repo.Save(); return(RedirectToAction(nameof(Index))); } catch { return(View(goalItem)); } }
internal void SetGoal(List <ObjectHome> listObject) { foreach (ObjectHome objHome in listObject) { GameObject instance = Instantiate(Resources.Load("GoalItem", typeof(GameObject))) as GameObject; instance.transform.SetParent(transform, false); instance.transform.SetAsFirstSibling(); GoalItem draggableItemComponent = instance.GetComponent <GoalItem>(); if (draggableItemComponent != null) { foreach (Sprite sprite in m_itemSprites) { if (sprite.name.Contains(objHome.nameFile)) { draggableItemComponent.SetImage(sprite); draggableItemComponent.SetText(objHome.numberObject + ""); } } } goalItemNameLink.Add(objHome.nameFile, draggableItemComponent); goalItemCountLink.Add(objHome.nameFile, objHome.numberObject); } }
public override void Notify(GoalItem item) { nbSpaceshipDestroyed++; }
public virtual void Notify(GoalItem item) { }