Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Blaze-Brigade
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Susan Yuen
Blaze-Brigade
Commits
5721b4e9
Commit
5721b4e9
authored
8 years ago
by
Trandinh Thien
Browse files
Options
Downloads
Patches
Plain Diff
Fixed crash after player owns no units
parent
2f11080f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Blaze-Brigade/Blaze_Brigade/Game.cs
+13
-6
13 additions, 6 deletions
src/Blaze-Brigade/Blaze_Brigade/Game.cs
src/Blaze-Brigade/Blaze_Brigade/GameState.cs
+2
-1
2 additions, 1 deletion
src/Blaze-Brigade/Blaze_Brigade/GameState.cs
with
15 additions
and
7 deletions
src/Blaze-Brigade/Blaze_Brigade/Game.cs
+
13
−
6
View file @
5721b4e9
...
...
@@ -224,12 +224,7 @@ namespace Controller
Debug
.
WriteLine
(
player1
.
getNumOfUnits
());
if
(
GameFunction
.
isGameOver
(
player1
,
player2
))
{
// TODO: game over screen
Debug
.
WriteLine
(
"Game is over."
);
break
;
}
if
(
GameFunction
.
isTurnOver
())
{
...
...
@@ -243,12 +238,24 @@ namespace Controller
foreach
(
Unit
unit
in
player1
.
getUnits
())
{
GameFunction
.
removeDeceasedUnit
(
graph
,
player1
,
unit
);
if
(
GameFunction
.
isGameOver
(
player1
,
player2
))
{
// TODO: game over screen
Debug
.
WriteLine
(
"Game is over."
);
break
;
}
}
// removes deceased units in Player 2
foreach
(
Unit
unit
in
player2
.
getUnits
())
{
GameFunction
.
removeDeceasedUnit
(
graph
,
player2
,
unit
);
if
(
GameFunction
.
isGameOver
(
player1
,
player2
))
{
// TODO: game over screen
Debug
.
WriteLine
(
"Game is over."
);
break
;
}
}
break
;
}
...
...
This diff is collapsed.
Click to expand it.
src/Blaze-Brigade/Blaze_Brigade/GameState.cs
+
2
−
1
View file @
5721b4e9
...
...
@@ -65,7 +65,8 @@ namespace Model
Playing
,
// Playing game Screen
DropDownMenu
,
// Drop down menu for action
CharMenu
,
// character drop down info menu
AttackMenu
// attack menu
AttackMenu
,
// attack menu
GameOver
// Game is Over
}
/*
enumerated list for what the current turn state is (per unit)
...
...
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