Beispiel #1
0
    /// <summary>
    /// Returns list of all unique activites that should appear on given calendar day.
    /// </summary>
    /// <param name="currentTimeCalendarArg"></param>
    /// <returns></returns>
    private List <HavenActivityData> GetUniqueActivitiesBasedOnCurrentDay(
        TimeCalendarSystem currentTimeCalendarArg)
    {
        // initialize return list as empty list
        List <HavenActivityDataTemplate> uniqueActivityTemplates = new
                                                                   List <HavenActivityDataTemplate>();

        // check cases based on current day's day of week
        switch (currentTimeCalendarArg.GetCurrentDayOfWeek())
        {
        case DayOfWeek.Tuesday:
            /*uniqueActivityTemplates.Add(AssetRefMethods.
             *  LoadBundleAssetUniqueHavenActivityTemplate("1"));*/
            break;

        case DayOfWeek.Thursday:
            /*uniqueActivityTemplates.Add(AssetRefMethods.
             *  LoadBundleAssetUniqueHavenActivityTemplate("1"));*/
            break;
        }

        // initialize return list as empty list
        List <HavenActivityData> returnList = new List <HavenActivityData>();

        // loop through all loaded templates
        foreach (HavenActivityDataTemplate iterTemplate in uniqueActivityTemplates)
        {
            // add iterating template's activity to return list
            returnList.Add(new HavenActivityData(iterTemplate));
        }

        // return populated list
        return(returnList);
    }
Beispiel #2
0
    /// <summary>
    /// Returns random day activities based on given calendar day.
    /// </summary>
    /// <param name="timeCalendarArg"></param>
    /// <returns></returns>
    private List <HavenActivityData> GetAvailableActivities(TimeCalendarSystem timeCalendarArg)
    {
        // initialize day's activites as empty list
        List <HavenActivityData> dayActivities = new List <HavenActivityData>();

        // if today is when the shooter game state mode is supposed to take place
        if (timeCalendarArg.GetCurrentDayOfWeek() == GetShooterGameplayDayOfWeek())
        {
            // stop code early, return populated activity list
            return(dayActivities);
        }

        // add all unique activities based on given time day
        dayActivities.AddRange(GetUniqueActivitiesBasedOnCurrentDay(timeCalendarArg));

        // get remaining activites needed for the given day
        int remainingActivitiesNeeded = GetNumberOfActivityOptionsPerDay() - dayActivities.Count;

        // if still need some activites for day
        if (remainingActivitiesNeeded > 0)
        {
            // add random activites
            dayActivities.AddRange(GetRandomNonUniqueActivities(remainingActivitiesNeeded));
        }

        // return populated activity list
        return(dayActivities);
    }
    /// <summary>
    /// Sets all the HUD calendar properties appropriately.
    /// </summary>
    public void RefreshHudCalendar()
    {
        // if singleton references NOT setup yet
        if (_gameManager == null)
        {
            // DONT continue code
            return;
        }

        // get game's current calendar data
        TimeCalendarSystem currentCalendar = _gameManager.HavenData.calendarSystem;

        // set day of week text to current abreviated version of current day of week
        dayOfWeekText.text = GetDayOfWeekAbbreviation(currentCalendar.GetCurrentDayOfWeek());

        // time of day image to current time slot's icon
        timeOfDayImage.sprite = GetTimeOfDayIcon(currentCalendar.currentTimeSlot);
    }
Beispiel #4
0
 /// <summary>
 /// Returns whether today is day where shooter state takes place.
 /// </summary>
 /// <returns></returns>
 public bool IsTodayShooterSectionDay()
 {
     return(calendarSystem.GetCurrentDayOfWeek() == activityPlanning.
            GetShooterGameplayDayOfWeek());
 }