encapsulate dict and list

This commit is contained in:
2016-02-05 02:13:03 +06:00
parent 8c4b0eccac
commit a4061b9af0
5 changed files with 84 additions and 45 deletions

View File

@@ -165,16 +165,15 @@ namespace IsoTools {
// ---------------------------------------------------------------------
public class InternalState {
public bool Dirty = false;
public bool Placed = false;
public Rect ScreenRect = new Rect();
public float Offset3d = 0.0f;
public IsoUtils.MinMax MinMax3d = IsoUtils.MinMax.zero;
public Vector2 MinSector = Vector2.zero;
public Vector2 MaxSector = Vector2.zero;
public Dictionary<IsoObject, int> SelfDependsD = new Dictionary<IsoObject, int>();
public IsoList<IsoObject> SelfDependsL = new IsoList<IsoObject>();
public HashSet<IsoObject> TheirDepends = new HashSet<IsoObject>();
public bool Dirty = false;
public bool Placed = false;
public Rect ScreenRect = new Rect();
public float Offset3d = 0.0f;
public IsoUtils.MinMax MinMax3d = IsoUtils.MinMax.zero;
public Vector2 MinSector = Vector2.zero;
public Vector2 MaxSector = Vector2.zero;
public IsoAssocList<IsoObject> SelfDepends = new IsoAssocList<IsoObject>(47);
public IsoAssocList<IsoObject> TheirDepends = new IsoAssocList<IsoObject>(47);
}
public InternalState Internal = new InternalState();
@@ -278,10 +277,6 @@ namespace IsoTools {
// ---------------------------------------------------------------------
void Awake() {
Internal.SelfDependsD = new Dictionary<IsoObject, int>(47);
Internal.SelfDependsL = new IsoList<IsoObject>(47);
Internal.TheirDepends = new HashSet<IsoObject>(new IsoObject[47]);
Internal.TheirDepends.Clear();
FixLastProperties();
FixIsoPosition();
}