magikusgierus
magikusgierus
CC#
Created by magikusgierus on 5/15/2024 in #help
Nam of this pattern?
ok, thanks
23 replies
CC#
Created by magikusgierus on 5/15/2024 in #help
Nam of this pattern?
So it's more advance version of doing something like
enum SavingFlag
{Fighting, Location, Cutscene}

HashSet<SavingFlag> SavingFlags;

bool CanPlayerSave()
{
return SavingFlags.Count == 0;
}
enum SavingFlag
{Fighting, Location, Cutscene}

HashSet<SavingFlag> SavingFlags;

bool CanPlayerSave()
{
return SavingFlags.Count == 0;
}
but has the added ability to not only prevent saving, but modify other things?
23 replies
CC#
Created by magikusgierus on 5/15/2024 in #help
Nam of this pattern?
and then you create List<Flag> Flags somwhere and add/remove?
23 replies
CC#
Created by magikusgierus on 5/15/2024 in #help
Nam of this pattern?
ah, ok
23 replies
CC#
Created by magikusgierus on 5/15/2024 in #help
Nam of this pattern?
thanks
23 replies
CC#
Created by magikusgierus on 5/15/2024 in #help
Nam of this pattern?
like "sealed" and "record"
23 replies
CC#
Created by magikusgierus on 5/15/2024 in #help
Nam of this pattern?
That's a very interesting snippet, I'll have to look up some things
23 replies
CC#
Created by magikusgierus on 5/15/2024 in #help
Nam of this pattern?
I guess I already do, I would just have to type them
23 replies
CC#
Created by magikusgierus on 5/15/2024 in #help
Nam of this pattern?
Okay, I get it. But it would require me to know all the flags from the start, right?
23 replies
CC#
Created by magikusgierus on 3/2/2024 in #help
Joining arrays
Not entirely, even if I do it at the start (and not when loading level for example), the next GC cycle may happen in 20 secends, so 20 seconds after starting the game the player will get a dip
8 replies
CC#
Created by magikusgierus on 3/2/2024 in #help
Joining arrays
Okay, I had to do some operations on those structs in the end I used a List and did nested foreach with .Add()
8 replies
CC#
Created by magikusgierus on 3/2/2024 in #help
Joining arrays
I feel time performance is not as important as memory performance, I fear Garbage Collector stepping in to free those arrays and dipping one frame. But I guess it will happen only once anyway
8 replies