Skip to content

Change state model #19

@ahasselbring

Description

@ahasselbring

After German Open: The members of game_controller::types::Game after sides and before teams should be represented about as follows:

enum PenaltyShootoutActiveState {
  Wait,
  Playing,
  AfterShot,
}

enum PenaltyShootoutState {
  BeforePenaltyShootout,
  Timeout(Timer),
  Active {
    timer: Timer,
    state: PenaltyShootoutActiveState,
    for: Side
  },
}

enum Half {
  First,
  Second,
}

enum SetPlayType {
  KickOff,
  GoalKick,
  KickIn,
  CornerKick,
  // ...
}

enum SetPlayPhase {
  Setup(Timer), // TODO: timeout-rewind-timer
  Wait, // TODO: timeout-rewind-timer
  Playing(Timer),
}

enum BeforeKickOffState {
  BeforeHalf,
  Timeout(Timer),
}

enum NormalState {
  BeforeKickOff {
    state: BeforeKickOffState,
    next_for: Side,
  },
  SetPlay {
    ty: SetPlayType,
    phase: SetPlayPhase,
    for: Side,
  },
  Playing,
  AfterHalf,
}

enum State {
  Normal {
    half: Half,
    timer: Timer,
    state: NormalState,
  },
  PenaltyShootout(PenaltyShootoutState),
}

The control message can still be created from this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions