-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is FlxSave.validate
private?
#3058
Comments
if we make validate public, it should be renamed to something less vague like validateSavePath (keep and deprecate the old private func too in case anyone was using @:privateAccess, and rather than making invalidChars read only, lets add a public isValidSavePath(). |
Also if you're calling |
I'm making a syetem where the player can select multiple saves, or have the ability to create new ones while also being able to change their name, I want to validate the name inputted to make sure it's valid |
what about having multiple save slots under one actual save? pretty sure you can use a Maps in FlxSave or if not, can use DynamicAccess, example: final data:DynamicAccess<{score:Int, levelsCompleted:Int}> = cast FlxG.save.data;
if (data.exists(saveSlotName))
{
final slotData = data.get(saveSlotName);
trace('score: ${slotData.score}, levels completed: ${slotData.levelsCompleted}');
}
else
{
data.set(saveSlotName, { score: 0, levelsCompleted:0 });
trace('No existing slot named "$saveSlotName", creating new one');
FlxG.save.data.flush();
} |
FlxSave.validate
andFlxSave.validateAndWarn
are not public functions. Is there a reason for this? The requirement of needing a@:privateAccess
call seems unnecessary.Fields such as
invalidChars
are also private, this could be avoided by making the setter null.The text was updated successfully, but these errors were encountered: