Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wargames
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Edvard Christian Berg Schøyen
Wargames
Merge requests
!4
updated files
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
updated files
master
into
main
Overview
0
Commits
1
Pipelines
0
Changes
12
Merged
Edvard Christian Berg Schøyen
requested to merge
master
into
main
3 years ago
Overview
0
Commits
1
Pipelines
0
Changes
12
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
4725e38c
1 commit,
3 years ago
12 files
+
29
−
25
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
12
Search (e.g. *.vue) (Ctrl+P)
Wargames/src/main/java/edu/ntnu/idatt2001/Army.java
+
6
−
5
Options
@@ -34,10 +34,7 @@ public class Army {
public
boolean
hasUnits
(){
boolean
hasUnites
=
false
;
if
(
this
.
units
.
size
()
>
0
){
hasUnites
=
true
;
}
boolean
hasUnites
=
this
.
units
.
size
()
>
0
;
return
hasUnites
;
}
@@ -51,7 +48,11 @@ public class Army {
@Override
public
String
toString
()
{
return
"Army "
+
name
+
" with units "
+
units
;
String
results
=
": "
;
for
(
Unit
unit
:
units
){
results
+=
unit
.
toString
()
+
" "
;
}
return
"The army: "
+
name
+
", with remaining units "
+
results
;
}
@Override
Loading