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
d489e61d
Commit
d489e61d
authored
8 years ago
by
Susan Yuen
Browse files
Options
Downloads
Patches
Plain Diff
Updated unit class
parent
ea30498e
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/Unit.cs
+4
-0
4 additions, 0 deletions
src/Blaze-Brigade/Blaze_Brigade/Unit.cs
src/Blaze-Brigade/Blaze_Brigade/Warrior.cs
+17
-2
17 additions, 2 deletions
src/Blaze-Brigade/Blaze_Brigade/Warrior.cs
with
21 additions
and
2 deletions
src/Blaze-Brigade/Blaze_Brigade/Unit.cs
+
4
−
0
View file @
d489e61d
...
...
@@ -2,6 +2,8 @@
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
Microsoft.Xna.Framework.Graphics
;
using
Microsoft.Xna.Framework
;
namespace
Model
{
...
...
@@ -19,6 +21,8 @@ namespace Model
Weapon
[]
getEquipableWeapons
();
// returns array of equipable weapons
int
getLevel
();
// returns unit's level
UnitType
getClass
();
// returns unit's class (warrior, mage, archer)
Texture2D
getSpriteImage
();
// returns the sprite image of the unit
Vector2
getCurrentPosition
();
// returns the current position (pixel coordinates) of the sprite
}
enum
UnitType
{
Warrior
,
Archer
,
Mage
};
//defines the possible classes of a unit
...
...
This diff is collapsed.
Click to expand it.
src/Blaze-Brigade/Blaze_Brigade/Warrior.cs
+
17
−
2
View file @
d489e61d
...
...
@@ -2,6 +2,8 @@
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
Microsoft.Xna.Framework.Graphics
;
using
Microsoft.Xna.Framework
;
namespace
Model
{
...
...
@@ -18,11 +20,14 @@ namespace Model
private
int
criticalRate
;
private
int
level
;
private
Weapon
[]
equipableWeapons
;
private
Texture2D
spriteImage
;
private
Vector2
position
;
public
Warrior
(
Player
p
)
public
Warrior
(
Texture2D
image
,
Vector2
positionCoordinates
)
{
// TODO: setup pre-determined stats for warrior
player
=
p
;
spriteImage
=
image
;
position
=
positionCoordinates
;
}
public
bool
isAlive
()
...
...
@@ -84,5 +89,15 @@ namespace Model
{
return
UnitType
.
Warrior
;
}
public
Texture2D
getSpriteImage
()
{
return
spriteImage
;
}
public
Vector2
getCurrentPosition
()
{
return
position
;
}
}
}
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