Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualJustinDaniel

Posted 16 March 2012 - 12:03 AM

I'm a bit confused on what you said, But as far as i read.
class Player
{
	 private:
	 bool charmander;
	 public:
	 Player();
	 void SetPokemon();
	 bool getChoice();
};

Player::Player()
{
	 charmander = false;
}

void Player::SetPokemon()
{
	if( //condtions met here.. )
	{
		 charmander = true;
    }
}

bool Player::getChoice()
{
	 return charmander;
}

class Enemy
{
	 public:
	 void SetPokemon( bool choice );
};

int main()
{
	 Player thisPlayer;
	 Enemy thisEnemy;
	 thisEnemy.SetPokemon(thisPlayer.getChoice());
	 //Do all the stuff;
}

Or you can simply use Inheritance to just directly acces the boolean choice and update everything in the enemy class. Its all upto you.

#2JustinDaniel

Posted 16 March 2012 - 12:03 AM

I'm a bit confused on what you said, But as far as i read.
class Player
{
	 private:
	 bool charmander;
	 public:
	 Player();
	 void SetPokemon();
	 bool getChoice();
};

Player::Player()
{
	 charmander = false;
}

void Player::SetPokemon()
{
	if( //condtions met here.. )
	{
		  charmander = true;
    }
}

bool Player::getChoice()
{
	 return charmander;
}

class Enemy
{
	 public:
	 void SetPokemon( bool choice );
};

int main()
{
	 Player thisPlayer;
	 Enemy thisEnemy;
	 thisEnemy.SetPokemon(thisPlayer.getChoice());
	 //Do all the stuff;
}

Or you can simply use Inheritance to just directly acces the boolean choice and update everything in the enemy class. Its all upto you.

#1JustinDaniel

Posted 16 March 2012 - 12:02 AM

I'm a bit confused on what you said, But as far as i read.
class Player
{
	 private:
	 bool charmander;
	 public:
	 Player();
	 void SetPokemon();
	 bool getChoice();
};

Player::Player()
{
	 charmander = false;
}

void Player::SetPokemon()
{
    if( //condtions met here.. )
    {
		  charmander = true;
	 }
}

bool Player::getChoice()
{
	 return charmander;
}

class Enemy
{
	 public:
	 void SetPokemon( bool choice );
};

int main()
{
	 Player thisPlayer;
	 Enemy thisEnemy;
	 thisEnemy.SetPokemon(thisPlayer.getChoice());
	 //Do all the stuff;
}

Or you can simply use Inheritance to just directly acces the boolean choice and update everything in the enemy class. Its all upto you.

PARTNERS