Changeset 85da778 in network-game


Ignore:
Timestamp:
Nov 11, 2014, 1:26:14 AM (10 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
6ba31d2
Parents:
48801af
Message:

Convert the client to use the PlayerTeam enum

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • client/Client/GameRender.cpp

    r48801af r85da778  
    9696         al_draw_filled_circle(pos.x, pos.y, 14, al_map_rgb(0, 0, 0));
    9797     
    98       if (p->team == 1)
     98      if (p->team == Player::TEAM_BLUE)
    9999         color = al_map_rgb(0, 0, 255);
    100       else if (p->team == 2)
     100      else if (p->team == Player::TEAM_RED)
    101101         color = al_map_rgb(255, 0, 0);
    102102      else {
  • client/Client/main.cpp

    r48801af r85da778  
    15461546void joinWaitingArea() {
    15471547   cout << "joining waiting area" << endl;
    1548    currentPlayer->team = 0;
     1548   currentPlayer->team = Player::TEAM_NONE;
    15491549
    15501550   msgTo.type = MSG_TYPE_JOIN_TEAM;
     
    15561556void joinBlueTeam() {
    15571557   cout << "joining blue team" << endl;
    1558    currentPlayer->team = 1;
     1558   currentPlayer->team = Player::TEAM_BLUE;
    15591559
    15601560   msgTo.type = MSG_TYPE_JOIN_TEAM;
     
    15661566void joinRedTeam() {
    15671567   cout << "joining red team" << endl;
    1568    currentPlayer->team = 2;
     1568   currentPlayer->team = Player::TEAM_RED;
    15691569
    15701570   msgTo.type = MSG_TYPE_JOIN_TEAM;
  • common/Game.cpp

    r48801af r85da778  
    184184         switch (it->type) {
    185185            case OBJECT_BLUE_FLAG:
    186                if (p->team == 2) {
     186               if (p->team == Player::TEAM_RED) {
    187187                  p->hasBlueFlag = true;
    188188                  itemId = it->id;
     
    190190               break;
    191191            case OBJECT_RED_FLAG:
    192                if (p->team == 1) {
     192               if (p->team == Player::TEAM_BLUE) {
    193193                  p->hasRedFlag = true;
    194194                  itemId = it->id;
Note: See TracChangeset for help on using the changeset viewer.