Paranoid Bastard
kiwifarms.net
- Joined
- Dec 17, 2019
Unless something's changed in newer versions of unity, then yes, unity cannot serialize most generic containers, or even most generics. IIRCList<T>
is an exception to this, as are arrays. However, storing student data in an array isn't necessarily a terrible idea, though using numeric constants like11
to specify specific students is definitely a terrible idea. I get the feeling that yandev just doesn't know what anenum
is.
The reason you might want to store student data in an array is for easy iteration, so that you can apply a function across all students with basically no overhead. For this kind of purpose I'd personally prefer a sparse array of students, using GUIDs as the indices of generic students, and a small range of predefined students using enum values as their indices. Of course, unity being unity you'd need a custom container for this purpose, and so it's probably easier to just use a list or array.
TBF though this is the guy who has used strings in place of enums, so he might have done this for no better reason than that he's a dum dum.
Actually, it does look like he knows what an enum is. However, that doesn't stop him from using them weirdly.
As an example, let's take a look at two separate enums, both from student script.
public enum StudentActionType
{
AtLocker = 0,
Socializing = 1,
Gaming = 2,
Shamed = 3,
Slave = 4,
Relax = 5,
SitAndTakeNotes = 6,
Peek = 7,
ClubAction = 8,
SitAndSocialize = 9,
SitAndEatBento = 10,
ChangeShoes = 11,
GradePapers = 12,
Patrol = 13,
Read = 14,
Texting = 15,
Mourn = 16,
Cuddle = 17,
Teaching = 18,
SearchPatrol = 19,
Wait = 20,
Clean = 21,
Gossip = 22,
Graffiti = 23,
Bully = 24,
Follow = 25,
Sulk = 26,
Sleuth = 27,
Stalk = 28,
Sketch = 29,
Sunbathe = 30,
Shock = 31,
Miyuki = 32,
Meeting = 33,
Lyrics = 34,
Practice = 35,
Sew = 36,
Paint = 37
}
// [af] Perhaps in the future some of the "tuples" can be split up into individual
// elements in a list, and then the code would check if the list contains certain
// witness types.
public enum StudentWitnessType
{
None,
Accident,
Blood,
BloodAndInsanity,
Corpse,
Eavesdropping,
Insanity,
Interruption,
Lewd,
Murder,
Pickpocketing,
CleaningItem,
Suspicious,
Stalking,
Theft,
Trespassing,
Violence,
Poisoning,
Weapon,
WeaponAndBlood,
WeaponAndBloodAndInsanity,
WeaponAndInsanity,
BloodPool,
SeveredLimb,
BloodyWeapon,
DroppedWeapon,
CoverUp,
HoldingBloodyClothing
}
So yeah, he does know enums exist and apparently uses them at points. There are not, however, enums for students. There are no words.