// Constructors public WorldRepresentation(StaticState staticState, DynamicState dynamicState = null, Interpretation interpretation = null) { StaticState = staticState ?? throw new ArgumentNullException("staticState", "ERROR: Tried to instantiate a new WorldRepresentation with no Static State. This is illegal because Dynamic-State information and Interpretation information both depend on Static State information"); if (dynamicState == null && interpretation != null) { throw new ArgumentNullException("dynamicState", "ERROR: Tried to instantiate a new WorldRepresentation with Interpretation but no Dynamic State. This is illegal because Interpretation information depends on Dynamic State information"); } DynamicState = dynamicState ?? DynamicState.CreateEmpty(staticState.NumberOfNodes); Interpretation = interpretation ?? Interpretation.CreateEmpty(staticState.NumberOfNodes); NumberOfNodes = staticState.NumberOfNodes; }
private WorldRepresentation(WorldRepresentation other, StaticState staticState, DynamicState dynamicState, Interpretation interpretation) { StaticState = staticState ?? other.StaticState; DynamicState = dynamicState ?? other.DynamicState; Interpretation = interpretation ?? other.Interpretation; }