魔兽世界一 备战

第一次写..分了好几个类..希望扩展性强一些

#include 
using namespace std;
string WarriorType[5] = {"dragon","ninja","iceman","lion","wolf"};//dragon,ninja,iceman,lion,wolf
int redOrder[6] = {0,3,4,5,2,1};
int blueOrder[6] = {0,4,1,2,3,5};
int _i = 1,_j = 1;
int openingNo = 0;
int warriorHP[6];
int minHp;

class Warrior{
public:
    int hp;
    int id;
    int type;//1d,2n,3i,4l,5w
    Warrior(){}
    Warrior(int _hp,int _id,int _type):hp(_hp),id(_id),type(_type){}
};

class HeadQuarter{
public:
    int mana;
    int redNo = 0;
    int blueNo = 0;
    string HQtype;
    bool isOver = 0;
    HeadQuarter(){};
    HeadQuarter(int _mana,string _type){
        mana = _mana;
        HQtype = _type;
    }
    int warriorCount[6] = {0};


    void SpawnFunc(string _HQtype){

        if(isOver)return;
        if(mana5){
                    i%=5;
                    if(i==0)i=5;
                }
                if(warriorHP[redOrder[i]]>mana) {
                    ++_i;
                    continue;
                }

                else{
                    Warrior troop(warriorHP[redOrder[i]],++redNo,redOrder[i]);
                    //cout << i<< _i<5){
                    j%=5;
                    if(j==0)j=5;
                };

                if(warriorHP[blueOrder[j]]>mana){
                    ++_j;
                    continue;
                }
                else{
                    Warrior troop(warriorHP[blueOrder[j]],++blueNo,blueOrder[j]);
                   // cout << j <<_j<>M;
        RED.mana = BLUE.mana = M;
    }
    void initWarrior(){
        for(int i = 1;i<=5;i++){
            cin>>warriorHP[i];
        }
        minHp = 10000;
        for(int i = 1;i<=5;i++){
            if(warriorHP[i]> t;
        for(int i = 0; i < t; i++){
            Game game;
            game.reset();
            cout<<"Case:"<

你可能感兴趣的:(Coding)