forked from RoboCup-SPL/GameController
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from sheepsy90/master
Release Candidate merge
- Loading branch information
Showing
31 changed files
with
362 additions
and
387 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package controller.action.ui; | ||
|
||
import controller.action.ActionType; | ||
import controller.action.GCAction; | ||
import data.PlayerInfo; | ||
import data.states.AdvancedData; | ||
import data.values.GameTypes; | ||
import data.values.Penalties; | ||
import data.values.Side; | ||
|
||
public class DropInPointsEvaluation extends GCAction { | ||
|
||
private final Side scoring_side; | ||
|
||
public DropInPointsEvaluation(Side scoring_side) { | ||
super(ActionType.UI); | ||
this.scoring_side = scoring_side; | ||
} | ||
|
||
@Override | ||
public void perform(AdvancedData data) { | ||
for(PlayerInfo pi : data.getTeam(this.scoring_side).player){ | ||
if (pi.penalty == Penalties.NONE) { | ||
pi.dropInPoints += 1; | ||
} | ||
} | ||
|
||
for(PlayerInfo pi : data.getTeam(this.scoring_side.getOther()).player){ | ||
pi.dropInPoints -= 1; | ||
} | ||
|
||
data.gameClock.addExtraClock("Add point for scoring robot!", 10); | ||
} | ||
|
||
@Override | ||
public boolean isLegal(AdvancedData data) { | ||
return true; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package controller.action.ui; | ||
|
||
import controller.action.ActionType; | ||
import controller.action.GCAction; | ||
import data.states.AdvancedData; | ||
import data.values.GameTypes; | ||
import data.values.Side; | ||
|
||
public class DropinPointDelta extends GCAction { | ||
|
||
private final Side side; | ||
private final int player; | ||
private final int delta; | ||
|
||
public DropinPointDelta(Side side, int player, int delta) { | ||
super(ActionType.UI); | ||
this.player = player; | ||
this.side = side; | ||
this.delta = delta; | ||
} | ||
|
||
@Override | ||
public void perform(AdvancedData data) { | ||
data.getTeam(this.side).player[this.player].dropInPoints += this.delta; | ||
} | ||
|
||
@Override | ||
public boolean isLegal(AdvancedData data) { | ||
return data.gameType == GameTypes.DROPIN || data.testmode; | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.