Skip to content

Instantly share code, notes, and snippets.

@karol-lotkowski
Created August 19, 2015 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karol-lotkowski/aa982fcec2f04cdec7a2 to your computer and use it in GitHub Desktop.
Save karol-lotkowski/aa982fcec2f04cdec7a2 to your computer and use it in GitHub Desktop.
Implementation of abstract class (RPG context)
package com.karollotkowski.game;
import java.util.Random;
public class WarriorSkills extends CombatSkills {
private static final int STRENGTH = 10;
private static final int MANA = 0;
@Override
protected int fight() {
return new Random().ints(0, STRENGTH).findFirst().getAsInt();
}
@Override
protected int spell() {
return MANA;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment