VeshApiBattle/main.cpp
// Returns 0 if the player starts and 1 if the enemy starts
Returns 0 if the player starts and 1 if the enemy starts
Returns 0 if the player starts and 1 if the enemy starts
int CalculateStarter(Battle* b)
{
	int pSPD = 0;
	for (unsigned int i = 0; i < b->GetPlayer()->GetCharacters().size(); i++)
	{
		pSPD += b->GetPlayer()->GetCharacterAt(i)->GetSPD();
	}
	int eSPD = 0;
	for (unsigned int i = 0; i < b->GetEnemy()->GetCharacters().size(); i++)
	{
		eSPD += b->GetEnemy()->GetCharacterAt(i)->GetSPD();
	}
	if (pSPD >= eSPD)
	{
		return 0;
	}
	else
	{
		return 1;
	}
}
int CalculateStarter ( Battle * b ) { int pSPD = 0 ; for ( unsigned int i = 0 ; i < b -> GetPlayer ( ) -> GetCharacters ( ) . size ( ) ; i ++ ) { pSPD += b -> GetPlayer ( ) -> GetCharacterAt ( i ) -> GetSPD ( ) ; } int eSPD = 0 ; for ( unsigned int i = 0 ; i < b -> GetEnemy ( ) -> GetCharacters ( ) . size ( ) ; i ++ ) { eSPD += b -> GetEnemy ( ) -> GetCharacterAt ( i ) -> GetSPD ( ) ; } if ( pSPD >= eSPD ) { return 0 ; } else { return 1 ; } }
Returns 0 if the player starts and 1 if the enemy starts
Returns 0 if the player starts and 1 if the enemy starts
// Total player Speed // Total enemy Speed