forked from ss13remake/ss13remake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored "Position" out of clientside entities and into a Transform…
…Component
- Loading branch information
spoogemonster
committed
Jul 28, 2013
1 parent
ed5eec4
commit d104478
Showing
56 changed files
with
270 additions
and
147 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
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
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,47 @@ | ||
using System; | ||
using GorgonLibrary; | ||
using SS13_Shared; | ||
using SS13_Shared.GO; | ||
|
||
namespace CGO | ||
{ | ||
public class TransformComponent : GameObjectComponent | ||
{ | ||
private Vector2D _position = Vector2D.Zero; | ||
|
||
public Vector2D Position | ||
{ | ||
get { return _position; } | ||
set | ||
{ | ||
_position = value; | ||
|
||
if (OnMove != null) OnMove(this, new VectorEventArgs(_position)); | ||
} | ||
} | ||
|
||
public event EventHandler<VectorEventArgs> OnMove; | ||
|
||
public TransformComponent() :base() | ||
{ | ||
Family = ComponentFamily.Transform; | ||
} | ||
|
||
public float X | ||
{ | ||
get { return Position.X; } | ||
set { Position = new Vector2D(value, Position.Y); } | ||
} | ||
|
||
public float Y | ||
{ | ||
get { return Position.Y; } | ||
set { Position = new Vector2D(Position.X, value);} | ||
} | ||
|
||
public override void Shutdown() | ||
{ | ||
Position = Vector2D.Zero; | ||
} | ||
} | ||
} |
Oops, something went wrong.