MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Team_Create

Function Team_Create

src/team.c:75–96  ·  view source on GitHub ↗

* Create a new Team. * * @param houseID The House of the new Team. * @param teamActionType The teamActionType of the new Team. * @param movementType The movementType of the new Team. * @param minMembers The minimum amount of members in the new Team. * @param maxMembers The maximum amount of members in the new Team. * @return The new created Team, or NULL if something failed. */

Source from the content-addressed store, hash-verified

73 * @return The new created Team, or NULL if something failed.
74 */
75Team *Team_Create(uint8 houseID, uint8 teamActionType, uint8 movementType, uint16 minMembers, uint16 maxMembers)
76{
77 Team *t;
78
79 t = Team_Allocate(0xFFFF);
80
81 if (t == NULL) return NULL;
82 t->flags.used = true;
83 t->houseID = houseID;
84 t->action = teamActionType;
85 t->actionStart = teamActionType;
86 t->movementType = movementType;
87 t->minMembers = minMembers;
88 t->maxMembers = maxMembers;
89
90 Script_Reset(&t->script, g_scriptTeam);
91 Script_Load(&t->script, teamActionType);
92
93 t->script.delay = 0;
94
95 return t;
96}
97
98/**
99 * Convert the name of a team action to the type value of that team action, or

Callers 1

Scenario_Load_TeamFunction · 0.85

Calls 3

Team_AllocateFunction · 0.85
Script_ResetFunction · 0.85
Script_LoadFunction · 0.85

Tested by

no test coverage detected