Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3877 in orxonox.OLD for orxonox/trunk/src/world_entities/weapon.cc


Ignore:
Timestamp:
Apr 18, 2005, 5:34:39 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: the player now works entirely with the WeaponManager. much more elegant! but its not yet finished.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapon.cc

    r3875 r3877  
    7777void WeaponManager::nextWeaponConf()
    7878{
     79  PRINTF(3)("Changing weapon configuration: from %i ", this->currConfID);
    7980  int i;
    8081  for(i = this->currConfID; i < W_MAX_CONFIGS && !this->configs[i].bUsed; ++i);
    8182  if( i == W_MAX_CONFIGS) this->currConfID = W_CONFIG0;
    8283  else this->currConfID = i; 
     84  PRINTF(3)("to %i\n", this->currConfID);
    8385}
    8486
     
    105107}
    106108
     109
     110void WeaponManager::tick(float sec)
     111{
     112  Weapon* w;
     113  for(int i = 0; i < W_MAX_SLOTS; ++i)
     114    {
     115      w = this->configs[this->currConfID].slots[i];
     116      if( w != NULL) w->tick(sec);
     117    }
     118}
     119
     120
     121void WeaponManager::draw()
     122{
     123  Weapon* w;
     124  for(int i = 0; i < W_MAX_SLOTS; ++i)
     125    {
     126      w = this->configs[this->currConfID].slots[i];
     127      if( w != NULL) w->draw();
     128    }
     129}
    107130
    108131/**
Note: See TracChangeset for help on using the changeset viewer.