public Dictionary <string, Dictionary <FakeInput, Dictionary <object, AtfActionRleQueue> > > Unpack(Slot slot) { if (slot == null) { return(null); } var result = new Dictionary <string, Dictionary <FakeInput, Dictionary <object, AtfActionRleQueue> > >(); foreach (var record in slot.content) { result[record.recordName] = new Dictionary <FakeInput, Dictionary <object, AtfActionRleQueue> >(); foreach (var fakeInputWithFipAndActions in record.fakeInputsWithFipsAndActions) { result[record.recordName][fakeInputWithFipAndActions.fakeInput] = new Dictionary <object, AtfActionRleQueue>(); foreach (var fipAndActions in fakeInputWithFipAndActions.fipsAndActions) { var newRleQueue = new AtfActionRleQueue { last = fipAndActions.last }; foreach (var metadata in fipAndActions.metadata) { newRleQueue.EnqueueWithoutOptimization(metadata.action.GetDeserialized()); newRleQueue.rleCounts.AddToBack(metadata.repetitions); } result[record.recordName][fakeInputWithFipAndActions.fakeInput][ParseFip(fipAndActions.fakeInputParameter)] = newRleQueue; } } } return(result); }
public void Enqueue(string recordName, FakeInput kind, object fakeInputParameter, AtfAction atfAction) { if (!_actionStorage.ContainsKey(recordName)) { _actionStorage.Add(recordName, new Dictionary <FakeInput, Dictionary <object, AtfActionRleQueue> >()); } if (!_actionStorage[recordName].ContainsKey(kind)) { _actionStorage[recordName].Add(kind, new Dictionary <object, AtfActionRleQueue>()); } if (!_actionStorage[recordName][kind].ContainsKey(fakeInputParameter)) { _actionStorage[recordName][kind][fakeInputParameter] = new AtfActionRleQueue(); } _actionStorage[recordName][kind][fakeInputParameter].Enqueue(atfAction); }