General Question Animation status=action

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,750
Reaction score
2,732
Points
203
Location
Dallas, TX
Ok I have looked in the APi doc and haven't found any thing about the differences and why you should you should use one over the other.

Code:
void MYVESSEL::ActivateCargo (DoorStatus action)
{
    cargo_status = action;
}

void MYVESSEL::RevertCargo (void)
{
    ActivateCargo (cargo_status == DOOR_CLOSED || cargo_status == DOOR_CLOSING ?
        DOOR_OPENING : DOOR_CLOSING);
}

VERSUS THIS:
Code:
void MYVESSEL::AnimateBagDoor ()
{
    bagdoor_status = (bagdoor_status == CLOSED || bagdoor_status == CLOSING ? OPENING : CLOSING);
}
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
I have looked in the APi doc and haven't found any thing about the differences
That's because it isn't a part of the API, but it's part of the logic of your program.

The first one you use if additionally to reverting the animation order you also want to set it in a specific state (of course you can also set the variable without using the setter function, too, if it's accessible for your code from somewhere else). The second one, if you only revert it.
 
Top