= FAQ = [[TracNav(TracNav/TOC_Development)]] [[TOC(inline, heading=Questions)]] ---- === Where's the makefile? === We use [wiki:CMake] as build system. Read [wiki:CMake the wikipage] for more information. === This Styleguide shit is a joke, right? My code just has to work! === No, you're code has to work AND be readable and understandable. Of course every piece of code can be understood somehow, but we don't want to puzzle. So, please, write your code in a common form. The [wiki:c++_styleguide styleguide] helps you on this topic. === I can't commit anything === You have to [wiki:SVN checkout] the repository via https. Http is anonymous and therefore can't be used to commit something. === What's that COUT(x) crap? === COUT(level) is a macro that works almost exactly like std::cout. The number inside the parentheses denotes the level of the output. Read [wiki:howto/Output this] for more information. === I don't get no output in my console/logfile/shell === First you have to use [wiki:howto/Output COUT] to send output to those devices. Then you have to ensure the maximal output level of the concerned device is >= the level of your output. You can configure those maximal levels in the [wiki:howto/ConfigFile config file]. There's a possible third problem: If your output comes too early (before the game has started) and the level of your output is > 2, it wont be displayed by default. If it's just for debuging purpose, change the value temporarily in util/OutputHandler.cc (constructor). If your output is really important for the game, use a lower level. === I have to call a function requesting a '!MultiType' but all I've got is an int/float/string/whatever === Just pass your variable to the function. [wiki:MultiType] is a class accepting almost all types of variables. C++ will do an implicit conversion. That's exactly the point about the !MultiType: no matter what you've got, you can call that fu**ing function. === I have to calculate something complicated, are there some helping functions? === Probably not, but check out [wiki:Math] to be sure. If your calculation is of common interest, please put it into util/Math.h too. === I have to manipulate a string, are there some helping functions? === Maybe, check out [wiki:String] to get an overview of the existing functions. If your stringmanipulation function is of common interest, please put it into util/String.h too. === I want to split a string into multiple tokens === Use [wiki:SubString]. === How can I convert a string into a number? === Use [wiki:Convert] or [wiki:MultiType]. === How can I convert typeX into typeY? === Use [wiki:Convert] or [wiki:MultiType] too, it's almighty. === What is std::string and what should I know about it? === std::string is part of the C++ standard. It's more than just a char array: It provides several useful functions, is much easier, more flexible and more safe. But this is not Java, so you will still get a crash if you access a char outside the range of the string. Read the [http://www.cplusplus.com/reference/string/string/ reference] for more information. === Why not using const char*? === Trust me, you really don't want to do this. [wiki:FAQ_coding#Whatisstd::stringandwhatshouldIknowaboutit std::string] is SO much easier, it's like day and night. Or like heaven and hell if you excuse the sanctimoniousness. === What is std::list / std::set / std::map / std::vector / std::stack / std::queue / std::pair? === All those are STL containers. They're part of the C++ standard and available on every system. Read the [wiki:howto/STL page about STL usage] for help and more information. === Why should I use STL containers? They're so weird! === They might look complicated, but as you get used to them, they'll be your friends. Everyone knows STL containers, so no one will missunderstand your code. They're powerful and bug free and are well [http://www.cplusplus.com/reference/stl/ documented]. Please don't implement your own list for every chickenshit.