Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Hexmission
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hexboard-games
Hexmission
Commits
3eeec671
Commit
3eeec671
authored
7 years ago
by
ODL guest ODL guest
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of git.fossgalaxy.com:ce810/ggj2017
parents
d414b04e
7977f3f8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/com/fossgalaxy/games/ggj2017/JamApp.java
+14
-0
14 additions, 0 deletions
src/main/java/com/fossgalaxy/games/ggj2017/JamApp.java
with
14 additions
and
0 deletions
src/main/java/com/fossgalaxy/games/ggj2017/JamApp.java
+
14
−
0
View file @
3eeec671
...
...
@@ -14,6 +14,7 @@ import javax.swing.JFrame;
import
javax.swing.JToolBar
;
import
com.fossgalaxy.games.rts.App
;
import
com.fossgalaxy.games.rts.GameDef
;
import
com.fossgalaxy.games.rts.GameState
;
import
com.fossgalaxy.games.rts.ai.Controller
;
import
com.fossgalaxy.games.rts.entity.Entity
;
...
...
@@ -21,6 +22,7 @@ import com.fossgalaxy.games.rts.entity.EntityType;
import
com.fossgalaxy.games.rts.io.SettingsIO
;
import
com.fossgalaxy.games.rts.order.Order
;
import
com.fossgalaxy.games.rts.order.OrderProcessor
;
import
com.fossgalaxy.games.rts.rules.Rule
;
import
com.fossgalaxy.games.rts.ui.GameAction
;
import
com.fossgalaxy.games.rts.ui.GameModel
;
import
com.fossgalaxy.games.rts.ui.GameView
;
...
...
@@ -40,6 +42,8 @@ public class JamApp
//create the initial game state
SettingsIO
io
=
new
SettingsIO
();
GameState
state
=
io
.
buildGame
(
"map.json"
);
GameDef
def
=
io
.
getGameDef
();
//create the players
//TODO clone, without it all moves WILL be applied twice.
...
...
@@ -53,6 +57,10 @@ public class JamApp
//create the thing that's doing the turn tracking.
OrderProcessor
processor
=
new
OrderProcessor
(
state
,
2
);
int
MAX_TURNS
=
100
;
for
(
Rule
rule
:
def
.
getRules
())
{
processor
.
addRule
(
rule
);
}
//turn loop
//TODO this might be better inside the turn processor?
...
...
@@ -69,7 +77,13 @@ public class JamApp
processor
.
doOrderBulk
(
orders
);
processor
.
finishTurn
();
if
(
processor
.
getWinner
()
!=
Rule
.
NO_WINNER
)
{
break
;
}
}
System
.
out
.
println
(
"Game over, player won: "
+
processor
.
getWinner
());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment