public void CreatePingPongTable(PingPongTableDTO pingPongTableDto)
        {
            var pingPongTable = PingPongTable.CreatePingPongTable(pingPongTableDto.WorkingStateId);

            pingPongTable.UpdatePingPongTable(pingPongTableDto.Name, pingPongTableDto.Bookings, pingPongTableDto.StartingHour, pingPongTableDto.EndingHour);

            _applicationDbContext.PingPongTables.Add(pingPongTable);
            _applicationDbContext.SaveChanges();
        }
Exemple #2
0
            public override bool Test(Sim a, PingPongTable target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (target.InUse)
                {
                    if (!target.IsHaunted)
                    {
                        if (target.IsActorUsingMe(a))
                        {
                            return(true);
                        }

                        greyedOutTooltipCallback = delegate
                        {
                            return(PingPongTable.LocalizeString("PingPongTableInUse", new object[0]));
                        };
                    }

                    return(false);
                }

                if (!Woohooer.Settings.mUnlockTeenActions)
                {
                    if (a.SimDescription.TeenOrBelow)
                    {
                        return(false);
                    }
                }

                if (PingPongTable.GetPotentialPlayers(a, target.LotCurrent, !Woohooer.Settings.mUnlockTeenActions, true).Count == 0)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.IsFemale, "Gameplay/Objects/Toys/PlayCatchObject:NoOneToPlayWith", new object[0]));
                    return(false);
                }

                return(true);
            }
 public void DeletePingPongTable(PingPongTable pingPongTable)
 {
     _applicationDbContext.PingPongTables.Remove(pingPongTable);
     _applicationDbContext.SaveChanges();
 }
Exemple #4
0
            public override bool Test(Sim a, PingPongTable target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (target.InUse)
                {
                    if (!target.IsHaunted)
                    {
                        if (target.IsActorUsingMe(a))
                        {
                            return true;
                        }

                        greyedOutTooltipCallback = delegate
                        {
                            return PingPongTable.LocalizeString("PingPongTableInUse", new object[0]);
                        };
                    }

                    return false;
                }

                if (!Woohooer.Settings.mUnlockTeenActions)
                {
                    if (a.SimDescription.TeenOrBelow)
                    {
                        return false;
                    }
                }

                if (PingPongTable.GetPotentialPlayers(a, target.LotCurrent, !Woohooer.Settings.mUnlockTeenActions, true).Count == 0)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.IsFemale, "Gameplay/Objects/Toys/PlayCatchObject:NoOneToPlayWith", new object[0]));
                    return false;
                }

                return true;
            }
Exemple #5
0
 public override void AddInteractions(InteractionObjectPair iop, Sim actor, PingPongTable target, List<InteractionObjectPair> results)
 {
     results.Add(new InteractionObjectPair(new Definition(PingPongTable.LocalizeString("PlayJuicePong", new object[0]) + Localization.Ellipsis, false), iop.Target));
 }
Exemple #6
0
 public override string GetInteractionName(Sim actor, PingPongTable target, InteractionObjectPair iop)
 {
     return base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target));
 }
Exemple #7
0
 public override void PopulatePieMenuPicker(ref InteractionInstanceParameters parameters, out List <ObjectPicker.TabInfo> listObjs, out List <ObjectPicker.HeaderInfo> headers, out int NumSelectableRows)
 {
     NumSelectableRows = 1;
     PopulateSimPicker(ref parameters, out listObjs, out headers, PingPongTable.GetPotentialPlayers(parameters.Actor as Sim, parameters.Target.LotCurrent, !Woohooer.Settings.mUnlockTeenActions, true), false);
 }
Exemple #8
0
 public override void AddInteractions(InteractionObjectPair iop, Sim actor, PingPongTable target, List <InteractionObjectPair> results)
 {
     results.Add(new InteractionObjectPair(new Definition(PingPongTable.LocalizeString("PlayJuicePong", new object[0]) + Localization.Ellipsis, false), iop.Target));
 }
Exemple #9
0
 public override string GetInteractionName(Sim actor, PingPongTable target, InteractionObjectPair iop)
 {
     return(base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target)));
 }