Ejemplo n.º 1
0
    /// <summary>
    /// Sets the current time slot to the next time slot.
    /// Returns whether next time slot is in a new day.
    /// </summary>
    public bool GoToNextTimeSlot()
    {
        switch (currentTimeSlot)
        {
        case TimeSlotType.Morning:
            currentTimeSlot = TimeSlotType.Afternoon;
            break;

        case TimeSlotType.Afternoon:
            currentTimeSlot = TimeSlotType.Evening;
            break;

        case TimeSlotType.Evening:
            currentTimeSlot = TimeSlotType.Morning;

            // return fact that next time slot is in a new day
            return(true);

        default:
            // print warning to console
            Debug.LogWarning($"Invalid currentTimeSlot: {currentTimeSlot.ToString()}");
            break;
        }

        // getting here means that next time slot is in the same day
        return(false);
    }
Ejemplo n.º 2
0
    private void Setup(TimeCalendarSystem templateArg)
    {
        currentDateTime = new DateTime(templateArg.currentDateTime.Year,
                                       templateArg.currentDateTime.Month, templateArg.currentDateTime.Day);

        currentTimeSlot = templateArg.currentTimeSlot;
    }
Ejemplo n.º 3
0
    private void Setup()
    {
        // start some ways into year on a monday
        currentDateTime = new DateTime(2020, 3, 2);

        currentTimeSlot = TimeSlotType.Morning;
    }
Ejemplo n.º 4
0
    public static Sprite LoadBundleAssetHavenLocationEventDialogueBackground(
        string eventIdArg, TimeSlotType timeSlotArg)
    {
        // initialize bundle properties
        string BUNDLE_NAME       = "HavenLocationEventDialogueBackground";
        string ASSET_NAME_PREFIX = $"eve-{eventIdArg}/bg-";

        // get start of name of asset to load
        string loadAssetName = ASSET_NAME_PREFIX + GetTimeDayIdAppend(timeSlotArg);

        // load and return asset
        return(LoadBundleAsset <Sprite>(BUNDLE_NAME, loadAssetName));
    }
Ejemplo n.º 5
0
    private void Setup()
    {
        dialogueName = string.Empty;

        requiredAdditionalGroupTraitProgression = 0;
        requiredFlag = string.Empty;

        associatedCharId = string.Empty;
        waifuChar        = WaifuCharacterType.None;
        // sets the character ID based on the set waifu char type, if appropriate
        SetupCharIdFromWaifuChar();

        associatedTimeSlot = TimeSlotType.None;
        focusesOnHcontent  = false;
    }
Ejemplo n.º 6
0
    private void Setup(DialogueEventData templateArg)
    {
        dialogueName = templateArg.dialogueName;

        requiredAdditionalGroupTraitProgression = templateArg.
                                                  requiredAdditionalGroupTraitProgression;
        requiredFlag = templateArg.requiredFlag;

        associatedCharId = templateArg.associatedCharId;
        waifuChar        = templateArg.waifuChar;
        // sets the character ID based on the set waifu char type, if appropriate
        SetupCharIdFromWaifuChar();

        associatedTimeSlot = templateArg.associatedTimeSlot;
        focusesOnHcontent  = templateArg.focusesOnHcontent;
    }
Ejemplo n.º 7
0
        public static TimeSlot CreateTimeSlot(TimeSlotType timeSlotType)
        {
            switch (timeSlotType)
            {
            case TimeSlotType.Control:
                return(new ControlTimeSlot());

            case TimeSlotType.Examination:
                return(new ExaminationTimeSlot());

            case TimeSlotType.Intervention:
                return(new InterventionTimeSlot());
            }
            throw new ArgumentException(
                      "Unrecognized type of time slot", nameof(timeSlotType));
        }
    /// <summary>
    /// Returns the icon associated with the given time slot.
    /// </summary>
    /// <param name="timeSlotArg"></param>
    /// <returns></returns>
    private Sprite GetTimeOfDayIcon(TimeSlotType timeSlotArg)
    {
        switch (timeSlotArg)
        {
        case TimeSlotType.Morning:
            return(timeOfDayIconMorning);

        case TimeSlotType.Afternoon:
            return(timeOfDayIconAfternoon);

        case TimeSlotType.Evening:
            return(timeOfDayIconEvening);

        default:
            return(null);
        }
    }
Ejemplo n.º 9
0
 void SetTimeSlotType(int hour)
 {
     if (hour >= 5 && hour < 11)//早上
     {
         curTimeSlotType = TimeSlotType.Morning;
     }
     else if (hour >= 11 && hour <= 13)//中午
     {
         curTimeSlotType = TimeSlotType.Noon;
     }
     else if (hour > 13 && hour <= 17)//下午
     {
         curTimeSlotType = TimeSlotType.Afternoon;
     }
     else if (hour > 17 && hour <= 21)//晚上
     {
         curTimeSlotType = TimeSlotType.Night;
     }
 }
Ejemplo n.º 10
0
    /// <summary>
    /// Returns the string ID that should be appeneded onto a load file asscoiated
    /// with the given time slot.
    /// </summary>
    /// <param name="timeSlotArg"></param>
    /// <returns></returns>
    private static string GetTimeDayIdAppend(TimeSlotType timeSlotArg)
    {
        // check cases based on given time slot and add a time slot ID appropriately
        switch (timeSlotArg)
        {
        case TimeSlotType.Morning:
            return("1");

        case TimeSlotType.Afternoon:
            return("2");

        case TimeSlotType.Evening:
            return("3");

        default:
            // print warning to console
            Debug.LogWarning("In GetTimeDayIdAppend(), invalid " +
                             $"timeSlotArg: {timeSlotArg.ToString()}");
            return("0");
        }
    }
Ejemplo n.º 11
0
 public void ChangeBackgroundL1FromHavenLocationEvent(string locationEventIdArg,
                                                      TimeSlotType timeSlotArg)
 {
     ChangeBackground(AssetRefMethods.LoadBundleAssetHavenLocationEventDialogueBackground(
                          locationEventIdArg, timeSlotArg), 1);
 }
Ejemplo n.º 12
0
 public void ChangeBackgroundL1FromHavenLocationActivityHub(HavenLocation locationArg,
                                                            TimeSlotType timeSlotArg)
 {
     ChangeBackground(AssetRefMethods.LoadBundleAssetHavenLocationActivityHubDialogueBackground(
                          locationArg, timeSlotArg), 1);
 }
Ejemplo n.º 13
0
 public void ChangeBackgroundL1FromHavenActivity(string havenActivityIdArg,
                                                 TimeSlotType timeSlotArg)
 {
     ChangeBackground(AssetRefMethods.LoadBundleAssetHavenActivityDialogueBackground(
                          havenActivityIdArg, timeSlotArg), 1);
 }