Game.Prefabs.CalendarEventTimes
Assembly: Assembly-CSharp.dll
Namespace: Game.Prefabs
Type: public enum
Base: System.Enum (underlying type: System.Int32)
Summary:
Defines discrete times of day used by calendar/event systems in the game. The enum members are assigned values as powers of two (1, 2, 4, 8), which makes them suitable for bitwise combination (i.e., treating the values as flags) even though the enum in source is not decorated with the [Flags] attribute. Use these values to represent single or multiple event time slots (Night, Morning, Afternoon, Evening).
Fields
-
Night = 1
Represents the night time slot. Value = 1. -
Morning = 2
Represents the morning time slot. Value = 2. -
Afternoon = 4
Represents the afternoon time slot. Value = 4. -
Evening = 8
Represents the evening time slot. Value = 8.
Properties
- This enum has no properties.
Constructors
- This enum has no explicit constructors. Enums have an implicit value-based constructor and default backing type of System.Int32.
Methods
- This enum declares no methods.
Usage Example
// Single value
CalendarEventTimes time = CalendarEventTimes.Morning;
// Bitwise combination (treating the enum as flags)
CalendarEventTimes morningAndEvening = CalendarEventTimes.Morning | CalendarEventTimes.Evening;
// Check if a combined value includes a specific time
bool hasMorning = (morningAndEvening & CalendarEventTimes.Morning) != 0;
// Another example: iterate possible flags
foreach (CalendarEventTimes t in new[] {
CalendarEventTimes.Night,
CalendarEventTimes.Morning,
CalendarEventTimes.Afternoon,
CalendarEventTimes.Evening })
{
if ((morningAndEvening & t) != 0)
{
// handle event for time 't'
}
}
Notes: - Although the source enum is not annotated with [Flags], its values are designed for bitwise combination. If you create your own compatible enum, consider adding [Flags] for clearer intent and nicer ToString() behavior.