FrameIT
|
Organizes (insertion/ deletion / etc. operations) and sepperates Fact spaces. Keeps track of insertion/ deletion actions for undo and redo. More...
Classes | |
struct | meta |
Each Fact entry in FactDict has a corresponding meta entry in MetaInf. The meta struct is a collection of meta-variables. <seealsocref="PruneWorkflow"/> More... | |
struct | stepnote |
Keeps track of insertion/ deletion/ etc. operations for undo and redo More... | |
Public Member Functions | |
FactOrganizer (bool invoke=false) | |
Standard Constructor for empty, ready to use FactOrganizer More... | |
bool | ContainsKey (string id) |
wrappes FactDict.ContainsKey(id ) More... | |
bool | ContainsLabel (string label) |
Looks up if there is a label Fact.Label in FactDict.Values More... | |
string | Add (Fact value, out bool exists, bool samestep=false) |
Call this to Add a Fact to this instance. More... | |
bool | Remove (Fact value, bool samestep=false) |
Call this to Remove a Fact from this instance. If other Facts depend on value Remove(/, true )will be called recursively/ cascadingly. More... | |
bool | Remove (string key, bool samestep=false) |
Call this to Remove a Fact from this instance. If other Facts depend on value Remove(/, true )will be called recursively/ cascadingly. More... | |
bool | safe_dependencies (string key, out List< string > dependencies) |
searches recursively for Facts where Fact.getDependentFactIds includes key / found dependencies More... | |
void | undo () |
Undoes an entire step or last softreset . No Fact will be actually added, removed or deleted; only its visablity and meta.active changes.
More... | |
void | redo () |
Redoes an entire step . No Fact will be actually added, removed or deleted; only its visablity and meta.active changes.
More... | |
void | Clear () |
Resets to "factory conditions". Neither deletes Facts nor invokes CommunicationEvents.RemoveFactEvent More... | |
void | hardreset (bool invoke_event=true) |
Resets to "factory conditions". deletes Facts and invokes CommunicationEvents.RemoveFactEvent iff invoke_event && invoke. More... | |
void | softreset () |
Undoes all worksteps (since marker) and sets soft_resetted to true . More... | |
void | fastforward () |
Redoes all worksteps (from marker onwards) and sets soft_resetted to false . More... | |
void | Draw (bool draw_all=false) |
Call this after assigning a stored instance in an empty world, that was not drawn. Redoes/ draws everything from marker = 0 to draw_all ? worksteps : backlog More... | |
void | Undraw (bool force_invoke=false) |
Undraws everything by invoking CommunicationEvents.RemoveFactEvent, that is meta.active, but does not change that satus. More... | |
bool | DynamiclySolved (SolutionOrganizer MinimalSolution, out List< List< string > > MissingElements, out List< List< string > > Solutions) |
Used to check wether this satisfies the constrains of an Solution. Only meta.active are accounted for. More... | |
Public Attributes | |
bool | invoke |
If set to true , Remove(string, bool) and Add(Fact, out bool, bool) will invoke CommunicationEvents.RemoveFactEvent and CommunicationEvents.AddFactEvent respectively. More... | |
Package Attributes | |
Dictionary< string, Fact > | FactDict |
Dictionary< string, meta > | MetaInf = new Dictionary<string, meta>() |
List< stepnote > | Workflow = new List<stepnote>() |
Keeps track of insertion/ deletion/ etc. operations for undo and redo More... | |
int | marker = 0 |
Notes position in Workflow for undo and redo; the pointed to element is non-acitve More... | |
int | worksteps = 0 |
Backlock logic redundant - for convinience. Keeps track of number of steps in Workflow. One step can consist of multiple operations.
| |
int | backlog = 0 |
Backlock logic redundant - for convinience. Keeps track of number of steps in Workflow, which are not set active. One step can consist of multiple operations.
| |
bool | soft_resetted = false |
Set to true if recently been resetted. More... | |
int | MaxLabelId = 0 |
Keeps track of maximum Fact.LabelId for Fact.generateLabel. More... | |
SortedSet< int > | UnusedLabelIds = new SortedSet<int>() |
Stores unused Fact.LabelId for Fact.generateLabel, wich were freed in Fact.freeAutoLabel for later reuse to keep naming space compact. More... | |
Properties | |
Fact | this[string id] [get] |
wrappes FactDict[id ]
| |
Private Member Functions | |
bool | FindEquivalent (Fact search, out string found, out bool exact) |
Looks for existent Fact (found ) which is very similar or identical (exact ) to prposed Fact (search ) More... | |
void | WorkflowAdd (stepnote note) |
prunes & adds note to Workflow; Invokes Events More... | |
void | PruneWorkflow () |
set current (displayed) state in stone, a.k.a. delete non meta.active Facts for good; resets un-redo parameters More... | |
void | yeetusdeletus (List< string > deletereverse, bool samestep=false) |
Turns every Fact in deletereverse (in reverse order) inactive, as it would be removed, but without checking for (recursive) dependencies. More... | |
void | reversestep (int pos, bool samestep=false) |
reverses any entire step; adds process to Workflow! More... | |
void | InvokeFactEvent (bool creation, string Id) |
Updates MetaInf, Fact.Label and invokes CommunicationEvents (latter iff invoke is set) More... | |
Static Private Member Functions | |
static void | FactOrganizerFromPublic (ref FactOrganizer set, PublicFactOrganizer exposed, bool invoke, out Dictionary< string, string > old_to_new) |
Used to parse JsonReader/ JsonWriter readable and creatable format of this class to an actual instance of this class. More... | |
string | path = null |
For store(string, List<Directories>, bool, bool) and load(ref FactOrganizer, bool, string, List<Directories>, bool, out Dictionary<string, string>) More... | |
static List< Directories > | hierState = new List<Directories> { Directories.FactStateMachines } |
For store(string, List<Directories>, bool, bool) and load(ref FactOrganizer, bool, string, List<Directories>, bool, out Dictionary<string, string>) More... | |
void | store (string name, List< Directories > hierarchie=null, bool use_install_folder=false, bool overwrite=true) |
void | delete () |
static bool | load (ref FactOrganizer set, bool draw, string name, List< Directories > hierarchie, bool use_install_folder, out Dictionary< string, string > old_to_new) |
static void | delete (string name, List< Directories > hierarchie, bool use_install_folder) |
static void | delete (string path) |
Organizes (insertion/ deletion / etc. operations) and sepperates Fact spaces. Keeps track of insertion/ deletion actions for undo and redo.
FactOrganizer.FactOrganizer | ( | bool | invoke = false | ) |
Standard Constructor for empty, ready to use FactOrganizer
invoke | sets invoke. |
string FactOrganizer.Add | ( | Fact | value, |
out bool | exists, | ||
bool | samestep = false |
||
) |
Call this to Add a Fact to this instance.
Warning: If return_value != value .Id, value will be deleted for good to reduce ressource usage!
void FactOrganizer.Clear | ( | ) |
Resets to "factory conditions". Neither deletes Facts nor invokes CommunicationEvents.RemoveFactEvent
bool FactOrganizer.ContainsKey | ( | string | id | ) |
bool FactOrganizer.ContainsLabel | ( | string | label | ) |
Looks up if there is a label Fact.Label in FactDict.Values
label | supposed Fact.Label to be checked |
true
iff FactDict conatains a Value
Fact, where Fact.Label == label .void FactOrganizer.delete | ( | ) |
TODO? move to interface? TODO: document
|
static |
TODO? move to interface? TODO: document
|
static |
TODO? move to interface? TODO: document
void FactOrganizer.Draw | ( | bool | draw_all = false | ) |
bool FactOrganizer.DynamiclySolved | ( | SolutionOrganizer | MinimalSolution, |
out List< List< string > > | MissingElements, | ||
out List< List< string > > | Solutions | ||
) |
Used to check wether this satisfies the constrains of an Solution. Only meta.active are accounted for.
MinimalSolution | describes constrains |
MissingElements | elements which were not found in SolutionOrganizer.ValidationSet in a format reflecting that of SolutionOrganizer.ValidationSet |
Solutions | elements which were found in SolutionOrganizer.ValidationSet in a format reflecting that of SolutionOrganizer.ValidationSet |
true
iff all constrains set by MinimalSolution are met
|
staticprivate |
Used to parse JsonReader/ JsonWriter readable and creatable format of this class to an actual instance of this class.
TODO: repair and use JSONManager.JsonInheritenceConverter<T> o.s. to bypass all of this hardwired implementation, including the entirety of PublicFactOrganizer
set | to be parsed into, will be overwritten. If invoke = true , set should be StageStatic.stage.factState, outherwise InvokeFactEvent(bool, string) will cause Exceptions when it invokes Events of CommunicationEvents |
exposed | instance to be parsed |
invoke | see invoke |
old_to_new | generated to map Key Fact.Id of exposed to corresponding Value Fact.Id of set |
.
void FactOrganizer.fastforward | ( | ) |
Redoes all worksteps (from marker onwards) and sets soft_resetted to false
.
|
private |
void FactOrganizer.hardreset | ( | bool | invoke_event = true | ) |
Resets to "factory conditions". deletes Facts and invokes CommunicationEvents.RemoveFactEvent iff invoke_event && invoke.
invoke_event | if set to true and invoke set to true will invoke CommunicationEvents.RemoveFactEvent |
|
private |
Updates MetaInf, Fact.Label and invokes CommunicationEvents (latter iff invoke is set)
|
static |
TODO? move to interface? TODO: document
|
private |
set current (displayed) state in stone, a.k.a. delete non meta.active Facts for good; resets un-redo parameters
void FactOrganizer.redo | ( | ) |
bool FactOrganizer.Remove | ( | Fact | value, |
bool | samestep = false |
||
) |
Call this to Remove a Fact from this instance. If other Facts depend on value Remove(/, true
)will be called recursively/ cascadingly.
this will not delete a Fact, but sets it inactive for later deletion when pruned.
value | to be removed |
samestep | set true if Fact deletion happens as a subsequent/ consequent step of multiple Fact creations and/or deletions, and you whish that these are affected by a single undo/ redo step |
true
iff value .Id was found.bool FactOrganizer.Remove | ( | string | key, |
bool | samestep = false |
||
) |
Call this to Remove a Fact from this instance. If other Facts depend on value Remove(/, true
)will be called recursively/ cascadingly.
this will not delete a Fact, but sets it inactive for later deletion when pruned.
key | to be removed |
samestep | set true if Fact deletion happens as a subsequent/ consequent step of multiple Fact creations and/or deletions, and you whish that these are affected by a single undo/ redo step |
true
iff value was found.
|
private |
reverses any entire step; adds process to Workflow!
Warning: unused therefore untested and unmaintained.
pos | position after steptail-end of the step to be reversed |
samestep | see yeetusdeletus(List<string>, bool).samestep |
bool FactOrganizer.safe_dependencies | ( | string | key, |
out List< string > | dependencies | ||
) |
searches recursively for Facts where Fact.getDependentFactIds includes key / found dependencies
key | to be cross referenced |
dependencies | all Facts where Fact.getDependentFactIds includes key / found dependencies |
false
if any dependencies are steprootsvoid FactOrganizer.softreset | ( | ) |
Undoes all worksteps (since marker) and sets soft_resetted to true
.
void FactOrganizer.store | ( | string | name, |
List< Directories > | hierarchie = null , |
||
bool | use_install_folder = false , |
||
bool | overwrite = true |
||
) |
TODO? move to interface? TODO: document
void FactOrganizer.undo | ( | ) |
void FactOrganizer.Undraw | ( | bool | force_invoke = false | ) |
Undraws everything by invoking CommunicationEvents.RemoveFactEvent, that is meta.active, but does not change that satus.
force_invoke | if set true , invokes CommunicationEvents.RemoveFactEvent for every Fact regardles of meta.active status or invoke |
|
private |
prunes & adds note to Workflow; Invokes Events
note | to be added |
|
private |
Turns every Fact in deletereverse (in reverse order) inactive, as it would be removed, but without checking for (recursive) dependencies.
deletereverse | to be removed, but without checking for (recursive) dependencies |
samestep | see Remove(string, bool).samestep. Only applies to last (first iteration) element of deletereverse ; for everything else samestep will be set to true . |
|
package |
|
staticprivate |
bool FactOrganizer.invoke |
If set to true
, Remove(string, bool) and Add(Fact, out bool, bool) will invoke CommunicationEvents.RemoveFactEvent and CommunicationEvents.AddFactEvent respectively.
|
package |
|
package |
Keeps track of maximum Fact.LabelId for Fact.generateLabel.
|
private |
|
package |
Set to true
if recently been resetted.
|
package |
Stores unused Fact.LabelId for Fact.generateLabel, wich were freed in Fact.freeAutoLabel for later reuse to keep naming space compact.
|
package |
|
get |