Skip to content

Commit bcd92aa

Browse files
Minor changes in protection
1 parent 3aef6ca commit bcd92aa

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Use build in file generator to create new instances for any of these types.
6464
abstract class Controller {
6565

6666
/// A reference to the controller.
67-
static Controller Instance;
67+
static Controller Instance { get; };
6868

6969
/// Method invoked when the controller is initializing.
7070
virtual void OnInitialize ();
@@ -109,6 +109,7 @@ abstract class EntityComponent<EntityComponentType, EntitySystemType> : UnityEng
109109

110110
/// Defines whether this component is enabled.
111111
bool isEnabled { get; };
112+
112113
/// Sets the game object of the entity active.
113114
void SetActive (bool value);
114115
/// Destroys the game object of the entity.
@@ -117,7 +118,6 @@ abstract class EntityComponent<EntityComponentType, EntitySystemType> : UnityEng
117118
void AddAsset (UnityEngine.Object asset);
118119
/// Loads a asset from the controller and adds it as an asset to the entity.
119120
void AddAsset (string name);
120-
121121
/// Sets the position of an entity.
122122
void SetPosition (float x, float y, float z = 0);
123123
/// Adds to the position of an entity.
@@ -149,15 +149,15 @@ abstract class EntitySystem<EntitySystemType, EntityComponentType> : IEntitySyst
149149
where EntityComponentType : EntityComponent<EntityComponentType, EntitySystemType>, new() {
150150

151151
/// An instance reference to the controller.
152-
static EntitySystemType Instance;
152+
static EntitySystemType Instance { get; };
153153
/// A list of the system's instantiated entity components.
154-
System.Collections.Generic.List<EntityComponentType> entities;
154+
System.Collections.Generic.List<EntityComponentType> entities { get; };
155155
/// The first instantiated entity compoent if this system.
156-
EntityComponentType entity;
156+
EntityComponentType entity { get; };
157157
/// Defines the number of instantiated entity components this system has.
158-
int entityCount;
158+
int entityCount { get; };
159159
/// Defines whether the system has instantiated entity components.
160-
bool hasEntities;
160+
bool hasEntities { get; };
161161

162162
/// Method invoked when the system will initialize.
163163
virtual void OnInitialize ();
@@ -230,7 +230,7 @@ abstract class Service<ServiceType> : IService
230230
where ServiceType : Service<ServiceType>, new() {
231231

232232
/// An instance reference to the service.
233-
static ServiceType Instance;
233+
static ServiceType Instance { get; };
234234

235235
/// Method invoked when the service will initialize.
236236
virtual void OnInitialize ();

Runtime/Controller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public abstract class Controller : UnityEngine.MonoBehaviour, IController {
1616
private bool isInitialized;
1717

1818
/// A reference to the controller.
19-
public static Controller Instance;
19+
public static Controller Instance { private set; get; } = null;
2020

2121
/// The assets that can be added to entities.
2222
public UnityEngine.Object[] assets;

Runtime/EntitySystem.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ public abstract class EntitySystem<EntitySystemType, EntityComponentType> : IEnt
99
private bool isInitialized = false;
1010

1111
/// An instance reference to the controller.
12-
public static EntitySystemType Instance;
12+
public static EntitySystemType Instance { private set; get; } = null;
1313

1414
/// A list of the system's instantiated entity components.
15-
public System.Collections.Generic.List<EntityComponentType> entities = new System.Collections.Generic.List<EntityComponentType> ();
15+
public System.Collections.Generic.List<EntityComponentType> entities { private set; get; } = new System.Collections.Generic.List<EntityComponentType> ();
1616

1717
/// The first instantiated entity compoent if this system.
18-
public EntityComponentType entity = null;
18+
public EntityComponentType entity { private set; get; } = null;
1919

2020
/// Defines the number of instantiated entity components this system has.
21-
public int entityCount = 0;
21+
public int entityCount { private set; get; } = 0;
2222

2323
/// Defines whether the system has instantiated entity components.
24-
public bool hasEntities = false;
24+
public bool hasEntities { private set; get; } = false;
2525

2626
/// Method invoked when the system will initialize.
2727
public virtual void OnInitialize () { }

Runtime/Service.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public abstract class Service<ServiceType> : IService
88
private bool isInitialized = false;
99

1010
/// An instance reference to the service.
11-
public static ServiceType Instance;
11+
public static ServiceType Instance { get; } = null;
1212

1313
/// Method invoked when the service will initialize.
1414
public virtual void OnInitialize () { }

0 commit comments

Comments
 (0)