public override void Save(IEvent eventObj) { if (eventObj is GettingPregnantEvent ev) { EventsRepo.Create(new Events() { ActionId = (int)ev.ActionType, StepId = DatabaseEventRecordingProvider.StepId, GameObjectId1 = ev.ActorId, }); } else { throw new InvalidDataException($"{eventObj} is invalid event"); } }
public override void Save(IEvent eventObj) { if (eventObj is GrowthEvent ev) { EventsRepo.Create(new Events() { ActionId = (int)ev.ActionType, StepId = DatabaseEventRecordingProvider.StepId, GameObjectId1 = ev.ActorId, BecameAdult = ev.BecameAdult, HpChange = ev.HpChange }); } else { throw new InvalidDataException($"{eventObj} is invalid event"); } }
public override void Save(IEvent eventObj) { if (eventObj is MovementEvent ev) { EventsRepo.Create(new Events { ActionId = (int)ev.ActionType, StepId = DatabaseEventRecordingProvider.StepId, GameObjectId1 = ev.ActorId, DirectionId = (int)ev.Direction, Distance = ev.Distance, MoveTypeId = (int)ev.MoveType }); } else { throw new InvalidDataException($"{eventObj} is invalid event"); } }
protected void getActiveEvents() { // Get Web Account's events that have not passed activeEvents = EventsRepo.GetActiveEvents(activeWebAccount.WebId); if (activeEvents != null && activeEvents.Count > 0) { lblOptions.Text = "Please select the event you would like to manage and the Credentials you would like to collect during the event."; ddlActiveEvents.DataSource = activeEvents; ddlActiveEvents.AppendDataBoundItems = true; ddlActiveEvents.DataTextField = "Name"; ddlActiveEvents.DataBind(); } else { lblOptions.Text = "You do not have any upcoming events to manage. Go to the Create Event page to create one!"; btnSelect.Visible = false; ddlActiveEvents.Visible = false; } }
public override void Save(IEvent eventObj) { if (eventObj is BirthEvent ev) { foreach (var childId in ev.ChildrenId) { EventsRepo.Create(new Events() { ActionId = (int)ev.ActionType, StepId = DatabaseEventRecordingProvider.StepId, GameObjectId1 = ev.ActorId, GameObjectId2 = childId }); } } else { throw new InvalidDataException($"{eventObj} is invalid event"); } }
protected void CreateNewEvent() { // Get Event Type var selection = ddlEventType.SelectedIndex; EventType type = (EventType)selection; var startT = txtDate.Text + " " + txtStartTime.Text; var endT = txtDate.Text + " " + txtEndTime.Text; Event ev = new Event { Name = txtName.Text, Location = txtLocation.Text, EventType = type, Date = DateTime.Parse(txtDate.Text), StartTime = DateTime.Parse(startT), EndTime = DateTime.Parse(endT), Description = txtDescription.Text, Owner = activeWebAccount.WebId }; EventsRepo.AddEvent(ev); lblStatus.Text = string.Format("Success! You have created the new Event: {0}.", ev.Name); }
public GettingPregnantSaver(LifeGameDBContext context, StepsRepo stepsRepo, EventsRepo eventsRepo, GameObjectsStepStateRepo gameObjectsStepStateRepo) : base(context, stepsRepo, eventsRepo, gameObjectsStepStateRepo) { }
public ValuesController(IOptions <LdapConfig> ldapConfig) { _ldapconfig = ldapConfig.Value; _eventsRepo = new EventsRepo(); }
public ReproductionSaver(LifeGameDBContext context, StepsRepo stepsRepo, EventsRepo eventsRepo, GameObjectsStepStateRepo gameObjectsStepStateRepo) : base(context, stepsRepo, eventsRepo, gameObjectsStepStateRepo) { }
public GivingBirthSaver(LifeGameDBContext context, StepsRepo stepsRepo, EventsRepo eventsRepo, GameObjectsStepStateRepo gameObjectsStepStateRepo) : base(context, stepsRepo, eventsRepo, gameObjectsStepStateRepo) { }
public PregnancyProgressionSaver(LifeGameDBContext context, StepsRepo stepsRepo, EventsRepo eventsRepo, GameObjectsStepStateRepo gameObjectsStepStateRepo) : base(context, stepsRepo, eventsRepo, gameObjectsStepStateRepo) { }
protected ActionEventSaver(LifeGameDBContext context, StepsRepo stepsRepo, EventsRepo eventsRepo, GameObjectsStepStateRepo gameObjectsStepStateRepo) : base(context, stepsRepo) { EventsRepo = eventsRepo; GameObjectsStepStateRepo = gameObjectsStepStateRepo; }