Skip to content

Instantly share code, notes, and snippets.

@Thanatossan
Created April 26, 2018 13:12
Show Gist options
  • Save Thanatossan/a1aa78b47d8df7bbc15da1c196c45e9b to your computer and use it in GitHub Desktop.
Save Thanatossan/a1aa78b47d8df7bbc15da1c196c45e9b to your computer and use it in GitHub Desktop.
#include <iostream>
#include <vector>
#include <string>
#include <ctime>
#include <cstdlib>
#include <iomanip>
using namespace std;
class bot{
public:
int side; // 1 is good -1 is bad
string character; // 1 is merlin 2 is servant of merlin 0 is assassin -1 is mondred -2 is servant of mondred
string name; //just a name
int botnumber; // bot number 1 number 2 blah blah...
int doubt; //use in bot function to tell what bot is doubt include player **if use in another fuction plaese set it 0
int current; //if current is '0' it means undentify side '1' is mean good side and '2' is bad side **if use in another fuction plaese set it 0
int king ; // to tell is a king or not 1 =king 0=a normal guy
int quest; // to tell who is going to do quest
int aod;
int sof;
int approve;
bot(int ,string ,string ,int ,int,int,int ) ; //to keep data of character
vector<int> getstates(); //to throw the bot construct into vector
void roleSet(int); //setting n players role format.
void shuffle(); //shuffle all roles before showing.
void showRole(); //show your character and ability.
void pick(char);
void botpick(char);
void check(int,int);
vector<int> vote;
};
class Avalon
{
public:
int side; //player
string character; //player
string name; //player
int doubt; //player
int current; //player
int checkturn;
int scoreoverall;
int king ; // to tell is a king or not 1 =king 0=a normal guy
int quest; // to tell who is going to do quest
bot *bots;
int approve;
int aod;
vector<string> allCharacter ;
Avalon(string ,string ,int ,int,int,int );
void chooseplayer(int numberofplayer,Avalon &currentplayer,int votephase1count);
void botfunction1(int numberofplayer,int m,bot *,bot *,bot *);
void roleSet(int); //setting n players role format.
void shuffle(); //shuffle all roles before showing.
void showRole(); //show your character and ability.
void pick(int);
void botpick(char);
void check(int,int);
};
class data{
public :
int vote;
int aod;
int checkturn;
int decline;
int approve;
int badwin;
int goodwin;
data(int,int);
};
data::data(int v=0,int c=0){
aod=c;
vote=v;
checkturn=1;
decline=0;
badwin=0;
goodwin=0;
approve=0;
}
Avalon::Avalon (string n,string charac,int s=0,int d=0,int k=0,int q=0) {
name=n;
character=charac;
side= s;
doubt=d;
king=k;
quest=q;
}
bot::bot (int botnum,string n,string charac=0,int s=0,int d=5,int k=0,int q=0) {
name=n;
character=charac;
botnumber=botnum;
side= s;
doubt=d;
king=k;
quest=q;
approve=0;
sof=0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment