25 lines
640 B
TypeScript
25 lines
640 B
TypeScript
// pitchGenerator
|
|
import type { Player } from "../types/Player";
|
|
import type { ThrownPitch } from "../types/ThrownPitch";
|
|
|
|
// a pitch can
|
|
// be thrown overhand, underhand, with spin that keeps it afloat or makes it a breaking ball,
|
|
// or be thrown with no spin (difficult) for a knuckleball.
|
|
// it can hit a batter, hit the dirt, or go wild.
|
|
|
|
export default function pitchGenerator(pitcher: Player) {
|
|
|
|
// what is the pitcher trying to throw?
|
|
// what is the count? how good is the batter? what *can* he throw?
|
|
|
|
const pitch: ThrownPitch = {
|
|
name: 'pitch',
|
|
speed: 0,
|
|
spinType: "6-12",
|
|
rpm: 200,
|
|
accuracy: 0.5
|
|
}
|
|
|
|
return pitch;
|
|
}
|