๐Ÿ“ฆ sleepyfran / duets

๐Ÿ“„ Career.Types.fs ยท 57 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57namespace Duets.Entities

[<AutoOpen>]
module CareerTypes =
    /// Defines all the different careers that the game supports.
    type CareerId =
        | Barista
        | Bartender
        | Chef
        | MusicProducer
        | RadioHost

    /// Wrapper around a byte that holds the stage number in which a career
    /// is currently in.
    type CareerStageId = CareerStageId of byte

    /// Defines all the different requirements that can be added to a specific
    /// career stage in order to unlock the next one.
    [<RequireQualifiedAccess>]
    type CareerStageRequirement =
        | Skill of SkillId * int
        | Fame of minLevel: int

    /// Number of day moments that it takes to perform a shift in a job.
    [<RequireQualifiedAccess>]
    type ShiftDuration = int<dayMoments>

    /// Defines the schedule of a job. Which each option meaning:
    /// - Free: No assigned schedule, player is free to work whenever they feel
    ///   like it.
    /// - Fixed: Fixed schedule with specific days of the week when work is allowed,
    ///   specific day moments when work can be performed, and a duration per shift.
    [<RequireQualifiedAccess>]
    type JobSchedule =
        | Free of duration: ShiftDuration
        | Fixed of workDays: DayOfWeek list * workDayMoments: DayMoment list * duration: ShiftDuration

    /// Defines the effect that performing a job's shift has on the character's
    /// attribute.
    type JobShiftAttributeEffect = CharacterAttribute * int

    /// Defines one specific stage inside of a career, which defines an ID and
    /// a base salary that will later get multiplied by the type of place that
    /// employees this stage.
    type CareerStage =
        { Id: CareerStageId
          BaseSalaryPerDayMoment: Amount
          Schedule: JobSchedule
          ShiftAttributeEffect: JobShiftAttributeEffect list
          Requirements: CareerStageRequirement list }

    /// Defines a job that either the character holds or can apply to.
    type Job =
        { Id: CareerId
          CurrentStage: CareerStage
          Location: RoomCoordinates }