make Camera & NPC fields readonly

This commit is contained in:
Colin McMillen 2020-03-10 15:06:25 -04:00
parent 8f79bb8680
commit 127693e2af
2 changed files with 3 additions and 2 deletions

View File

@ -13,8 +13,9 @@ namespace SemiColinGames {
public int Top { get => bbox.Top; } public int Top { get => bbox.Top; }
public Point HalfSize { get => new Point(Width / 2, Height / 2); } public Point HalfSize { get => new Point(Width / 2, Height / 2); }
private readonly Random random = new Random();
private float shakeTime = 0.0f; private float shakeTime = 0.0f;
private Random random = new Random();
public Matrix Projection { public Matrix Projection {
get => Matrix.CreateOrthographicOffCenter(Left, Left + Width, Height, 0, -1, 1); get => Matrix.CreateOrthographicOffCenter(Left, Left + Width, Height, 0, -1, 1);

View File

@ -52,7 +52,7 @@ namespace SemiColinGames {
private const int spriteCenterYOffset = 2; private const int spriteCenterYOffset = 2;
private readonly Vector2 eyeOffset = new Vector2(4, -3); private readonly Vector2 eyeOffset = new Vector2(4, -3);
private FSM<NPC> fsm; private readonly FSM<NPC> fsm;
public NPC(Point position, int facing) { public NPC(Point position, int facing) {
Position = position; Position = position;