예제 #1
0
        private static void ConsiderGeneratingPhoneCall()
        {
            Phone.RandomCallType weightedIndex = (Phone.RandomCallType)RandomUtil.GetWeightedIndex(new float[] { Phone.kChanceForNoCall, Phone.kChanceForRandomChat, Phone.kChanceForRandomInviteOver });
            switch (weightedIndex)
            {
            case Phone.RandomCallType.kChat:
                Sim            sim;
                SimDescription description;
                if (!RandomUtil.RandomChance01(Phone.kChanceForBoardingSchoolCallWhenChatting) || !FindCallParticipants(-100f, out sim, out description, Phone.RandomCallType.kBoardingSchool))
                {
                    if (RandomUtil.RandomChance01(Phone.kChanceToSuggestBachelorPartyWhenChatting) && FindCallParticipants(Phone.kLTRThresholdForSimToBeCalledChatMin, out sim, out description, Phone.RandomCallType.kSuggestBachelorParty))
                    {
                        PhoneService.PlaceCall(new BachelorParty.PhoneCallSuggestBachelorParty(sim, description), Phone.kRandomCallTimeout);
                    }
                    else if (RandomUtil.RandomChance01(Phone.kChanceToAskToPromWhenChatting) && FindCallParticipants(Phone.kLTRThresholdForSimToBeCalledChatMin, out sim, out description, Phone.RandomCallType.kAskToProm))
                    {
                        PhoneService.PlaceCall(new PromSituation.PhoneCallAskToProm(sim, description), Phone.kRandomCallTimeout);
                    }
                    else if (FindCallParticipants(Phone.kLTRThresholdForSimToBeCalledChatMin, out sim, out description, weightedIndex))
                    {
                        PhoneService.PlaceCall(new Phone.RandomChatCall(sim, description), Phone.kRandomCallTimeout);
                    }
                    break;
                }
                BoardingSchool.PlaceBoardingSchoolPhoneCall(sim, description, Phone.kRandomCallTimeout);
                break;

            case Phone.RandomCallType.kInviteOver:
                Sim            sim2;
                SimDescription description2;
                if (FindCallParticipants(Phone.kLTRThresholdForSimToBeInvitedOverMin, out sim2, out description2, weightedIndex))
                {
                    PhoneService.PlaceCall(new Phone.RandomInvitationCall(sim2, description2), Phone.kRandomCallTimeout);
                }
                break;
            }

            ScheduleNextCall(Phone.kMinimumCallInterval);
        }
예제 #2
0
            private void CallToInviteGuest(Sim host, Sim guest, DateAndTime startTime)
            {
                InvitationPhoneCall call = new InvitationPhoneCall(host, guest, startTime, mInvitationKeys);

                PhoneService.PlaceCall(call, 30f);
            }