Attacking is now a method of character class

I changed the game, so Attacking is  now a method of character class. It
works, but I have a problem - I don't now how to call the functions of
choosing_style, because it should differ for player and AI opponent.
I need something like "If attacker is a player, then let's him choose
style. If attacker is AI opponnent, let's choose style randomly" But I
don't know how to do it