You should inject the concrete strategy in your player Class via the Strategy interface. The Strategy then takes a player as argument:
1- the Interface:
public interface Strategy {
public void apply(Player player);
}
2- Concrete strategies:
public class StrategyOne implements Strategy{
public void apply(Player player) {
System.out.println(this.getClass().getSimpleName() +" on " + player.getName());
}
public class StrategyTwo implements Strategy {
public void apply(Player player) {
System.out.println(this.getClass().getSimpleName() +" on " + player.getName());
}
}
3- Context (here your player class):
public class Player {
private Strategy strategy;
private String name;
public String getName(){
return name;
}
public Player(Strategy strategy, String name){// construct using your chosen strategy
this.strategy = strategy;
this.name = name;
}
public void executeStrategy(Player player){
System.out.print("Player "+ this.getName()+ " applies ");
strategy.apply(player);
}
}
public static void main(String[] args) {
Player playerOne = new Player(new StrategyOne(), "playerOne");
Player playerTwo = new Player(new StrategyTwo(), "playerTwo");
playerOne.executeStrategy(playerOne);
playerOne.executeStrategy(playerTwo);
playerTwo.executeStrategy(playerTwo);
playerTwo.executeStrategy(playerOne);
}
5- Output:
Player playerOne applies StrategyOne on playerOne
Player playerOne applies StrategyOne on playerTwo
Player playerTwo applies StrategyTwo on playerTwo
Player playerTwo applies StrategyTwo on playerOne
Then you have your player applying the strategy that's been assigned to him on the player targeted by the strategy.