add tall decay type
This commit is contained in:
parent
7f9ca47b84
commit
89b01891b4
2 changed files with 34 additions and 5 deletions
|
@ -8,10 +8,7 @@ import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||||
import com.badlogic.gdx.utils.ScreenUtils;
|
import com.badlogic.gdx.utils.ScreenUtils;
|
||||||
import com.monjaro.gamejam.SegmentUI;
|
import com.monjaro.gamejam.SegmentUI;
|
||||||
import com.monjaro.gamejam.segment.DualSegment;
|
import com.monjaro.gamejam.segment.*;
|
||||||
import com.monjaro.gamejam.segment.KinSegment;
|
|
||||||
import com.monjaro.gamejam.segment.OlympicSegment;
|
|
||||||
import com.monjaro.gamejam.segment.Segment;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -41,7 +38,7 @@ public class Game extends ApplicationAdapter {
|
||||||
segUi = new SegmentUI();
|
segUi = new SegmentUI();
|
||||||
|
|
||||||
ui = new UI(this, 50, 280);
|
ui = new UI(this, 50, 280);
|
||||||
round = new Round(List.of(new OlympicSegment(1), new OlympicSegment(3), new KinSegment(3), new DualSegment(false)), List.of(new ParityDecay(true)), 5);
|
round = new Round(List.of(new OlympicSegment(1), new OlympicSegment(3), new KinSegment(3), new DualSegment(false)), List.of(new TallDecay()), 5);
|
||||||
|
|
||||||
Face.setBlankFaceSprite(new Texture("blank_die_face.png"));
|
Face.setBlankFaceSprite(new Texture("blank_die_face.png"));
|
||||||
Face.setPipSprite(new Texture("pip.png"));
|
Face.setPipSprite(new Texture("pip.png"));
|
||||||
|
|
32
core/src/com/monjaro/gamejam/segment/TallDecay.java
Normal file
32
core/src/com/monjaro/gamejam/segment/TallDecay.java
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
package com.monjaro.gamejam.segment;
|
||||||
|
|
||||||
|
import com.monjaro.gamejam.main.Decay;
|
||||||
|
import com.monjaro.gamejam.main.Die;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class TallDecay extends Decay {
|
||||||
|
|
||||||
|
public TallDecay() {
|
||||||
|
description = "All used dice with HIGHEST value decay.";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Die> getDecayed(List<Die> dice) {
|
||||||
|
int highestValue = -1;
|
||||||
|
List<Die> targets = new ArrayList<>();
|
||||||
|
|
||||||
|
for (Die die : dice) {
|
||||||
|
if (die.isFaceBlank()) continue;
|
||||||
|
|
||||||
|
if (die.getFaceValue() < highestValue) continue;
|
||||||
|
|
||||||
|
targets.add(die);
|
||||||
|
highestValue = die.getFaceValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
return targets;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue