public override void Save(IEvent eventObj) { if (eventObj is NewStepEvent ev) { StepsRepo.Create(new Steps { SessionId = DatabaseEventRecordingProvider.GameSessionId, Number = ev.StepNumber }); DatabaseEventRecordingProvider.StepId = StepsRepo.GetStepId(ev.StepNumber); } else { throw new InvalidDataException($"{eventObj} is invalid event"); } }
public GettingPregnantSaver(LifeGameDBContext context, StepsRepo stepsRepo, EventsRepo eventsRepo, GameObjectsStepStateRepo gameObjectsStepStateRepo) : base(context, stepsRepo, eventsRepo, gameObjectsStepStateRepo) { }
public ReproductionSaver(LifeGameDBContext context, StepsRepo stepsRepo, EventsRepo eventsRepo, GameObjectsStepStateRepo gameObjectsStepStateRepo) : base(context, stepsRepo, eventsRepo, gameObjectsStepStateRepo) { }
public StepSaver(LifeGameDBContext context, StepsRepo stepsRepo) : base(context, stepsRepo) { }
public GivingBirthSaver(LifeGameDBContext context, StepsRepo stepsRepo, EventsRepo eventsRepo, GameObjectsStepStateRepo gameObjectsStepStateRepo) : base(context, stepsRepo, eventsRepo, gameObjectsStepStateRepo) { }
public MapGenerationSaver(LifeGameDBContext context, StepsRepo stepsRepo, GameTilesRepo gameTilesRepo) : base(context, stepsRepo) { _gameTilesRepo = gameTilesRepo; }
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; }
protected StepEventSaver(LifeGameDBContext context, StepsRepo stepsRepo) : base(context) { StepsRepo = stepsRepo; }