novaleaf
novaleaf
CC#
Created by novaleaf on 10/18/2024 in #help
how to avoid "-0" when converting float to string?
i could just check ==0 but that's some special branching just for a single value so I'm wondering if there's something more graceful
6 replies
CC#
Created by D.Mentia on 12/4/2022 in #help
❔ Designing a Worker system for a game
also generally, don't track the resources, instead track the intent to aquire resources. then when performing the task it can find the best suited resource at that time.
5 replies
CC#
Created by D.Mentia on 12/4/2022 in #help
❔ Designing a Worker system for a game
not to be flippant, but I think if you work on the basic prototype of your idea, it will settle a lot of your concerns, just because you'll find that when you get to the point where you'd implement your above stated worker system, that your idea for the game has evolved so that it's no longer exactly as you currently envision
5 replies
CC#
Created by D.Mentia on 12/4/2022 in #help
❔ Designing a Worker system for a game
"no plan survives contact with the enemy" "The map is not the territory"
5 replies
CC#
Created by novaleaf on 12/4/2022 in #help
❔ Tersest way to get (up to) last 3 elements in an array? (source array may have less than 3 items!)
I have to learn linq more 4sure
5 replies
CC#
Created by novaleaf on 12/4/2022 in #help
❔ Tersest way to get (up to) last 3 elements in an array? (source array may have less than 3 items!)
cool that will work! 😄 much thanks
5 replies
CC#
Created by novaleaf on 12/4/2022 in #help
❔ Tersest way to get (up to) last 3 elements in an array? (source array may have less than 3 items!)
I guess something like this would work,, but I hope there is something more terse you can come up with 🙂
var splits = filePath.Split('\\');
var localFolders = splits[^Math.Min(splits.Length,3)..]
var splits = filePath.Split('\\');
var localFolders = splits[^Math.Min(splits.Length,3)..]
5 replies