return;
component.Actions.Clear();
- component.Actions.UnionWith(GetEntitySet(state.Actions));
+ component.Actions.UnionWith(EnsureEntitySet<ActionsComponent>(state.Actions, uid));
_actionHoldersQueue.Enqueue(uid);
}
}
}
- /*public void SaveActionAssignments(string path)
- {
-
- // Currently only tested with temporary innate actions (i.e., mapping actions). No guarantee it works with
- // other actions. If its meant to be used for full game state saving/loading, the entity that provides
- // actions needs to keep the same uid.
-
- var sequence = new SequenceDataNode();
-
- foreach (var (action, assigns) in Assignments.Assignments)
- {
- var slot = new MappingDataNode();
- slot.Add("action", _serializationManager.WriteValue(action));
- slot.Add("assignments", _serializationManager.WriteValue(assigns));
- sequence.Add(slot);
- }
-
- using var writer = _resourceManager.UserData.OpenWriteText(new ResourcePath(path).ToRootedPath());
- var stream = new YamlStream { new(sequence.ToSequenceNode()) };
- stream.Save(new YamlMappingFix(new Emitter(writer)), false);
- }*/
-
/// <summary>
/// Load actions and their toolbar assignments from a file.
/// </summary>