Created
November 13, 2017 12:02
-
-
Save nshiba/4045dcd3e41b4152ebd3f6ce4fd214c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
Predator predator = new Predator(1, "name", 3, 2, new int[] {1, 3, 10}, new int[] {2, 6, 20}, "test"); | |
predation(1, predator); | |
} | |
private void predation(int victimLevel, Predator predator) { | |
int dice = new Random().nextInt(6) + 1; | |
int eatResult = predator.eatPower[predator.level - 1] * dice * (predator.level - victimLevel); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Predator { | |
public float id; | |
public String name; | |
public int rank; | |
public int level; | |
public int[] eatPower = new int[] {1, 10, -1}; | |
public int[] increasePower = new int[] {3, 20, -1}; | |
public String skill; | |
public Predator(float id, String name, int rank, int level, int[] eatPower, int[] increasePower, String skill) { | |
this.id = id; | |
this.name = name; | |
this.rank = rank; | |
this.level = level; | |
this.eatPower = eatPower; | |
this.increasePower = increasePower; | |
this.skill = skill; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment