diff --git a/Assets/Scripts/InteractionEngine/Fact.cs b/Assets/Scripts/InteractionEngine/Fact.cs index f26c8e07d83537d75226c0817c340f755d781dfd..e7709422845922222a2b9db4f7db27aa92245689 100644 --- a/Assets/Scripts/InteractionEngine/Fact.cs +++ b/Assets/Scripts/InteractionEngine/Fact.cs @@ -84,7 +84,7 @@ public void rename(string newLabel) public virtual void delete() { - //TODO: MMT + //TODO: MMT: delete over there } public abstract bool Equivalent(Fact f2); @@ -98,6 +98,20 @@ public virtual void delete() protected string generateLetter() { return ((char)(64 + LabelId++ + 1)).ToString(); + + /* Keeping track of free Ids + private static List<int> NextEmpties = new List<int>(); + NextEmpties.Add(LabelId++); + + public int GetFirstEmptyID() + { + NextEmpties.Sort(); + + int id = NextEmpties[0]; + NextEmpties.RemoveAt(0); + if (NextEmpties.Count == 0) + NextEmpties.Add(LabelId++); + }*/ } } diff --git a/Assets/Scripts/InteractionEngine/FactManager.cs b/Assets/Scripts/InteractionEngine/FactManager.cs index 8f448fc04a1c58ffea59391f32d46c8681bbc79f..89a6cc7dfb5fa894d9356e5bddff71c7c8b17999 100644 --- a/Assets/Scripts/InteractionEngine/FactManager.cs +++ b/Assets/Scripts/InteractionEngine/FactManager.cs @@ -7,15 +7,7 @@ public class FactManager : MonoBehaviour { - private List<int> NextEmpties = new List<int>(); - - // Start is called before the first frame update - void Start() - { - NextEmpties.Add(0); - } - - //TODO! communicate success + //TODO! communicate success/ failure public static Fact AddFactIfNotFound(Fact fact, out bool exists, bool samestep) { return Facts[Facts.Add(fact, out exists, samestep)]; @@ -75,23 +67,9 @@ void AddHitIfOnLine(RaycastHit hit) return rayFact; } - public AngleFact AddAngleFact(string pid1, string pid2, string pid3, bool samestep = false) { return (AngleFact)AddFactIfNotFound(new AngleFact(pid1, pid2, pid3), out bool obsolete, samestep); } - public int GetFirstEmptyID() - { - NextEmpties.Sort(); - - int id = NextEmpties[0]; - NextEmpties.RemoveAt(0); - if (NextEmpties.Count == 0) - NextEmpties.Add(id + 1); - - Debug.Log("place fact at " + id); - - return id; - } }