Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon-Harad committed Dec 5, 2024
1 parent 68a204d commit 61ccb4c
Showing 1 changed file with 32 additions and 33 deletions.
65 changes: 32 additions & 33 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,70 +12,75 @@ export type User = {
};

/// Counts
export type AutoActionsTM = ActionsTM & {
bunny_intake_success: number;
bunny_intake_failure: number;
bunny_internal_success: number;
bunny_internal_failure: number;
bunny_external_success: number;
bunny_external_failure: number;
bunny_uncontrolled_success: number;
bunny_uncontrolled_failure: number;
bunny_low_success: number;
bunny_low_failure: number;
actions: AutoActionData[];
};

export type TeleActionsTM = ActionsTM & {
actions: TeleActionData[];
};

export type ActionsTM = {
id: number;
tote_intake_success: number;
tote_intake_failure: number;
tote_eject_success: number;
tote_eject_failure: number;
balloon_intake_success: number;
bollon_intake_failure: number;
balloon_intake_failure: number;
balloon_eject_success: number;
balloon_eject_failure: number;
score_low_success: number;
score_low_failure: number;
score_internal_success: number;
score_internal_failure: number;
score_external_success: number;
score_external_failure: number;
score_other_robot_success: number;
score_other_robot_failure: number;
};

export type AutoActionsTM = ActionsTM & {
bunny_intake_success: number;
bunny_intake_failure: number;
bunny_tote_success: number;
bunny_tote_failure: number;
bunny_low_success: number;
bunny_low_failure: number;
actions: AutoActionData[];
};

export type TeleActionsTM = ActionsTM & {
actions: TeleActionData[];
score_uncontrolled_success: number;
score_uncontrolled_failure: number;
bunny_eject_success: number;
bunny_eject_failure: number;
};

export type TeamMatch = {
id: number;
scout_id: string;
match_key: string;
team_key: string;
speed: number;
awareness: number;
skill_field_awareness: number;
skill_quickness: number;
notes: string;
broke: boolean;
died: boolean;
auto_actions: AutoActionData[];
tele_actions: TeleActionData[];
};

export type TeleActionData = {
action: TeleAction;
export type AutoActionData = {
action: AutoAction;
success: boolean;
ok: boolean;
};

export type AutoActionData = {
action: AutoAction;
export type TeleActionData = {
action: TeleAction;
success: boolean;
ok: boolean;
};

// Action Types
// Naming Convention: action_type + game_piece + where
export type TeleAction =
| 'IntakeTote'
| 'IntakeBalloon'
| 'IntakeBalloonCoral'
| 'ScoreBalloonInternalTote' // Held by scorer
| 'ScoreBalloonExternalTote' // Held by alliance member
| 'ScoreBalloonUncontrolledTote'
Expand All @@ -92,13 +97,7 @@ export type BunnyAction =
| 'ScoreBunnyLow';
export type AutoAction = TeleAction | BunnyAction;

export type TeleHeldItems = {
balloons: number;
totes: number;
};
export type AutoHeldItems = TeleHeldItems & { bunnies: number };

// For state machine
export type ItemInputState = 'Intake' | 'Score' | 'Eject' | 'None';
export type TeleInputState = TeleAction | ItemInputState;
export type AutoInputState = TeleInputState | BunnyAction;
export type AutoInputState = TeleInputState | BunnyAction;

0 comments on commit 61ccb4c

Please sign in to comment.