Untitled
unknown
plain_text
8 months ago
1.2 kB
6
Indexable
#include <vector>
#include<iostream>
#include <string>
enum class position{
QB,
RB,
TE,
WR
};
struct GameInfo{
int PlayerScore = 0;
int CompScore = 0;
int down = 1;
int yards = 0;
};
struct Player{
position::Position;
std::string name;
std::string team;
int jerseynumber;
int rating;
int passing_yards = 0;
int pass_attempts = 0;
int pass_complesions = 0;
int rushing_yards = 0;
int rush_attempts = 0;
};
struct Team{
std::string name;
std::vector<Player> roster;
};
enum class PlayType{
run,
rush
;}
void DisplayPossession(const Team& team);
void DisplayDownsandYards(const GameInfo& gameinfo);
PlayType ChoosePlayType(const Team& team);
double PassVsRushProb(const Team& team);
Player chooseRunner( Team& team);
Player chooseReciever(Team& team);
double PassSuccessProb(const player& QB, const player& reciever);
double RunSuccessProb(const player& QB, const player& runner);
void UpdateGame(Scoreboard& scoreboard, int yardsGained);
void UpdateGame(Scoreboard& scoreboard);
void UpdatePlayer(Player& player);Editor is loading...
Leave a Comment