* 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. */
| 73 | * @return The new created Team, or NULL if something failed. |
| 74 | */ |
| 75 | Team *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 |
no test coverage detected