-
Notifications
You must be signed in to change notification settings - Fork 56
Types
All basic in-game data types are covered by Intercept. You can find them in the intercept::types namespace. Important things to know are listed below.
The game value wrappers (most of the times) have a constructor to create the from basic data types. Therefore it is possible to implicitly cast them, so that you can assign i.e. normal floats to a function parameter.
Arrays can be constructed from std::vector
If you however need the array to be a game_value too, then you need to use auto_array as following:
game_value array_var = auto_array<game_value>(vector_var.begin(), vector_var.end());Most of Intercept's functions require parameters in form of game value wrapper types. Due to the ability to implicitly cast them, it is no problem to provide them by the basic equivalents (i.e. float, std::string, ...).
The implicit and the static cast will however sometimes require a memory allocation. This is bad when it comes to performance.
The game value wrappers share most of their usability with their basic equivalents, so it is better to not cast them and directly work with them.