Is there any easy/quick way to cast a boolean variable as an integer (0 or 1)?
I've got a series of hotspots that can be switched on/off, and I'd like to be able to use their state to also modify their sprite number (hotspot.Graphic -= hotspotState).
I could just store their state as a 0/1 integer, but it seems more efficient to store it as a boolean if possible.
Store those states as 'chars'. Boolean values won't be smaller than chars anyway.
And you won't need to cast them, since char is just integer... only smaller.
EDIT: Oh my, what am I saying...
AGS allows to simply add boolean to integer, so you don't need to cast anything yourself. Why did this question arise at first place?
Yeah, true is typecast to 1 and false to 0 anyway.
Aha - excellent. That's what I wanted to know, thanks guys!
Interestingly, AGS doesnt even have a bool type really. It just an Enum with values 0 and 1 and enums are just ints.
The more you know.