Draw a scene.
public enum SaveStates
{
Saved,
SavedWithChanges,
SavedWithoutChanges
}
In this case, the enumeration can be considered Saved
if it is SavedWithChanges
or SavedWithoutChanges
.
So, if I had such a variable:
SaveStates lastState = SaveStates.SavedWithoutChanges;
Ideally, I would like to do something like this:
if (lastState == SaveStates.Saved)
{
//The state is saved, do something awesome.
}
I can of course do this:
if (lastState == SaveStates.SavedWithChanges || lastState == SaveStates.SavedWithoutChanges)
{
...
However, this is a little tedious, and I cannot assume that another developer will understand how to use the enumeration correctly.
Each listing is required, as there may be an instance where we might want to do something specific in case of saving, where, for example, there were no changes.
I am open to alternative design ideas.
source
share