Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12145


Ignore:
Timestamp:
Dec 5, 2018, 10:54:17 AM (2 months ago)
Author:
samuelbl
Message:

Player fixed

Location:
code/branches/wagnis_HS18/src/modules/wagnis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc

    r12136 r12145  
    2121        this->province_selection_changed = false;
    2222        this->gameStage = NOT_READY;
     23        this->reinforcements = 0;
    2324    }
    2425    //Destructor
     
    6869                            orxout()<<"Sorry, someone already owns this provice"<<endl;
    6970                        }
    70                         //TODO: Set more troops to provinces before game begins
    7171
    7272                        break;
     
    220220    }
    221221
    222 
    223 
    224     //Manages a Players turn
    225     void WagnisPlayer::playerTurn(){
    226        
    227     }
    228222    //checks if a move is valid, possible MoveTypes: ATTACK, MOVE, SET_TROOPS, SET_TROOPS_INITIAL
    229223    bool WagnisPlayer::checkMove(MoveType move_type)
     
    265259        return false;
    266260    }
    267    
    268     //
    269     void WagnisPlayer::setTroops(WagnisProvince*){
    270 
    271     }
    272     void WagnisPlayer::attack(WagnisProvince*,WagnisProvince*){
    273 
    274     }
    275     void WagnisPlayer::moveTroops(WagnisProvince*,WagnisProvince*){
    276 
    277     }
     261
    278262    //Return a "Player x" String
    279263    std::string WagnisPlayer::toString(){
     
    318302    }
    319303
    320     int WagnisPlayer::best3(int a, int b, int c)
     304    int WagnisPlayer::best3(int a, int b, int c) //returns best of 3 integers for attack stage
    321305    {
    322306        if(a >= b && a>= c)
     
    328312    }
    329313
    330     int WagnisPlayer::best2(int a, int b)
     314    int WagnisPlayer::best2(int a, int b) //returns best of 2 integers for attack stage
    331315    {
    332316        if(a >= b)
     
    336320    }
    337321
    338     int WagnisPlayer::second3(int a, int b, int c)
     322    int WagnisPlayer::second3(int a, int b, int c) //returns second of 3 integers for attack stage
    339323    {
    340324        if((a >= b && a <= c)||(a <= b && a >= c))
     
    346330    }
    347331
    348     int WagnisPlayer::second2(int a, int b)
     332    int WagnisPlayer::second2(int a, int b) //returns second of 2 integers for attack stage
    349333    {
    350334        if(a <= b)
     
    353337            return b;   
    354338    }
    355 
    356     int WagnisPlayer::reinforcementCounter() //calculates and sets reeinforcements how many troops a player gets at beginning of his turn
    357     {
    358        
    359         reinforcements = 10;
    360         orxout()<<"derp"<<endl;
    361         /*
    362         int counter = 0;
    363 
    364         for (int i = 0; i <= 100; ++i)
    365         {
    366             if
    367         }
    368         */
    369 
    370     }
    371339}
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h

    r12136 r12145  
    5555        int second3(int, int, int);
    5656        int second2(int, int);
    57         int reinforcementCounter();
    5857    };
    5958}
Note: See TracChangeset for help on using the changeset viewer.