.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Programming
General Programming Help others and get yourself helped here!

Reply
 
Thread Tools
Re: [C++] Class names
Old
  (#11)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: [C++] Class names - 25-08-2005

Oh I didn't notice that before. Doh!

I think the only flaw with the methods now is if you forget to override/modify the constructor. That could be nasty.


sfx1999.postcount++
  
Reply With Quote
Re: [C++] Class names
Old
  (#12)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: [C++] Class names - 26-08-2005

Aspirin, why don't you do like with your real-time profiler ? Use a sort of string variable that is overwritten each time a class is instanced.

IMO that's the simplest way to do things.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: [C++] Class names
Old
  (#13)
DrEvil
Member
 
DrEvil's Avatar
 
Status: Offline
Posts: 142
Join Date: Jan 2004
Location: Los Angeles, CA
Default Re: [C++] Class names - 29-08-2005

Have you looked into the typeid operator? Does what I think you're asking about.


Omni-bot AI framework
http://www.omni-bot.com

Foxbot - for Team Fortress Classic
http://www.foxbot.net


  
Reply With Quote
Re: [C++] Class names
Old
  (#14)
cld
Member
 
Status: Offline
Posts: 3
Join Date: Oct 2005
Default Re: [C++] Class names - 06-10-2005

class CBot
{
public:
void print() { printf("bot\n");}
};
int main ( int argc, char** argv )
{
CBot bot1;
printf("Name of class bot1 is %s\n",typeid(bot1).name() );
}

is it?
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com