Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12308 for code/branches


Ignore:
Timestamp:
Apr 18, 2019, 3:44:09 PM (6 years ago)
Author:
ahuwyler
Message:

Bats are gone

Location:
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox
Files:
4 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt

    r12298 r12308  
    44  OrxoBloxWall.cc
    55  OrxoBloxBall.cc
    6   OrxoBloxBat.cc
    76  OrxoBloxBot.cc
    87  OrxoBloxCenterpoint.cc
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc

    r12307 r12308  
    3333
    3434#include "OrxoBlox.h"
     35#include "Highscore.h"
    3536
    3637#include "core/CoreIncludes.h"
    3738#include "core/EventIncludes.h"
    3839#include "core/command/Executor.h"
    39 #include "core/config/ConfigValueIncludes.h"
     40
     41
     42#include "core/config/ConfigValueIncludes.h"//Remove??
    4043
    4144#include "gamestates/GSLevel.h"
    42 #include "chat/ChatManager.h"
     45
     46
     47#include "chat/ChatManager.h"//Remove?
    4348
    4449#include "OrxoBloxCenterpoint.h"
    4550#include "OrxoBloxBall.h"
    46 #include "OrxoBloxBat.h"
    47 #include "OrxoBloxBot.h"
     51// #include "OrxoBloxBat.h"//Remove??
     52#include "OrxoBloxBot.h"//Remove??
    4853#include "OrxoBloxStones.h"
    4954#include "OrxoBloxWall.h"
     
    5257namespace orxonox
    5358{
    54     // Events to allow to react to scoring of a player, in the level-file.
    55     CreateEventName(OrxoBloxCenterpoint, right);
    56     CreateEventName(OrxoBloxCenterpoint, left);
     59   
    5760
    5861    RegisterUnloadableClass(OrxoBlox);
     
    148151
    149152
    150 
    151 
    152 
    153             // If one of the bats is missing, create it. Apply the template for the bats as specified in the centerpoint.
    154             for (WeakPtr<orxonox::OrxoBloxBat>& bat : this->bat_)
    155             {
    156                 if (bat == nullptr)
    157                 {
    158                     bat = new OrxoBloxBat(this->center_->getContext());
    159                     bat->addTemplate(this->center_->getBattemplate());
    160                 }
    161             }
    162 
    163 
    164153            // Create the first Wall.
    165154            this->createWall();
    166             orxout()<< "helloo"<< endl;
    167155
    168156        }
     
    257245    }
    258246
    259     // void OrxoBlox::createWall(void)             //TODO: random rotation offset between 0 and 3 (times 90°)
    260     // {
    261     //     // create new futureBrick_
    262     //     this->futureWall_ = new TetrisBrick(this->center_->getContext());
    263 
    264 
    265     //     // Apply the stone template to the stone.
    266     //     this->futureBrick_->addTemplate(this->center_->getBrickTemplate());
    267 
    268     //     // Attach the brick to the Centerpoint and set the position of the brick to be at the left side.
    269     //     this->center_->attach(this->futureBrick_);
    270     //     float xPos = (this->center_->getWidth()*1.6f + ((this->center_->getWidth() % 2)*2-1)/2.0f)*this->center_->getStoneSize();
    271     //     float yPos = (this->center_->getHeight()-5.1f)*this->center_->getStoneSize();
    272        
    273     //     this->futureBrick_->setPosition(xPos, yPos, 0.0f);
    274     //     this->futureBrick_->setGame(this);
    275     // }
    276247
    277248    /**
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h

    r12307 r12308  
    9696            WeakPtr<OrxoBloxCenterpoint> center_; //!< The playing field.
    9797            WeakPtr<OrxoBloxBall> ball_; //!< The OrxoBlox ball.
    98             WeakPtr<OrxoBloxBat> bat_[0]; //!< The two bats.
     98           
    9999            PlayerInfo* player_;
    100100
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc

    r12305 r12308  
    3939#include "gametypes/Gametype.h"
    4040
    41 #include "OrxoBloxBat.h"
    4241
    4342#include "sound/WorldSound.h"
     
    6160        this->speed_ = 0;
    6261        this->accelerationFactor_ = 1.0f;
    63         this->bat_ = nullptr;
    6462        this->bDeleteBats_ = false;
    65         this->batID_ = new unsigned int[2];
    66         this->batID_[0] = OBJECTID_UNKNOWN;
    67         this->batID_[1] = OBJECTID_UNKNOWN;
    6863        this->relMercyOffset_ = 0.05f;
    6964
     
    9792        {
    9893            if (this->bDeleteBats_)
    99                 delete[] this->bat_;
    10094
    10195            delete[] this->batID_;
     
    123117        registerVariable( this->speed_ );
    124118        registerVariable( this->relMercyOffset_ );
    125         registerVariable( this->batID_[0] );
    126         registerVariable( this->batID_[1], VariableDirection::ToClient, new NetworkCallback<OrxoBloxBall>( this, &OrxoBloxBall::applyBats) );
    127119    }
    128120
     
    217209    }
    218210
    219     /**
    220     @brief
    221         Set the bats for the ball.
    222     @param bats
    223         An array (of size 2) of weak pointers, to be set as the new bats.
    224     */
    225     void OrxoBloxBall::setBats(WeakPtr<OrxoBloxBat>* bats)
    226     {
    227         if (this->bDeleteBats_) // If there are already some bats, delete them.
    228         {
    229             delete[] this->bat_;
    230             this->bDeleteBats_ = false;
    231         }
    232 
    233         this->bat_ = bats;
    234         // Also store their object IDs, for synchronization.
    235         this->batID_[0] = this->bat_[0]->getObjectID();
    236         this->batID_[1] = this->bat_[1]->getObjectID();
    237     }
    238 
    239     /**
    240     @brief
    241         Get the bats over the network.
    242     */
    243     void OrxoBloxBall::applyBats()
    244     {
    245         // Make space for the bats, if they don't exist, yet.
    246         if (this->bat_ == nullptr)
    247         {
    248             this->bat_ = new WeakPtr<OrxoBloxBat>[2];
    249             this->bDeleteBats_ = true;
    250         }
    251 
    252         if (this->batID_[0] != OBJECTID_UNKNOWN)
    253             this->bat_[0] = orxonox_cast<OrxoBloxBat*>(Synchronisable::getSynchronisable(this->batID_[0]));
    254         if (this->batID_[1] != OBJECTID_UNKNOWN)
    255             this->bat_[1] = orxonox_cast<OrxoBloxBat*>(Synchronisable::getSynchronisable(this->batID_[1]));
    256     }
    257211
    258212    void OrxoBloxBall::setDefScoreSound(const std::string &OrxoBloxSound)
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h

    r12212 r12308  
    121121                { return this->batlength_; }
    122122
    123             void setBats(WeakPtr<OrxoBloxBat>* bats); //!< Set the bats for the ball.
     123           
    124124            void applyBats(); //!< Get the bats over the network.
    125125
     
    141141            float accelerationFactor_; //!< The acceleration factor of the ball.
    142142            float batlength_; //!< The length of the bats (in z-direction) as percentage of the height of the playing field.
    143             WeakPtr<OrxoBloxBat>* bat_; //!< An array with the two bats.
    144143            bool bDeleteBats_; //!< Bool, to keep track, of whether this->bat_ exists or not.
    145144            unsigned int* batID_; //!< The object IDs of the bats, to be able to synchronize them over the network.
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxPrereqs.h

    r12307 r12308  
    6969{
    7070    class OrxoBlox;
    71     class OrxoBloxAI;
    7271    class OrxoBloxBall;
    73     class OrxoBloxBat;
     72   
    7473    class OrxoBloxCenterpoint;
    7574    class OrxoBloxWall;
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc

    r12307 r12308  
    4242            return orxobloxGametype;
    4343        }
    44         else orxout()<<"There is no Gametype! ask Anna"<< endl;
     44        else orxout()<<"There is no Gametype for OrxoBlox! ask Anna"<< endl;
    4545        return nullptr;
    4646    }
Note: See TracChangeset for help on using the changeset viewer.