public void Dispose() { int idx = Pyramid.FindMyPosition(this); instances[idx] = null; // available slot // throw new NotImplementedException(); }
public static Pyramid Build() { if (_SingleInstance == null) { _SingleInstance = new Pyramid(); } return(_SingleInstance); }
private static int FindMyPosition(Pyramid pyramid) { for (int i = 0; i < instances.Count; i++) { if (instances[i] == pyramid) { return(i); } } return(-1); // never~~~ }