[C#] Confused about Pawn.Pawn_TimetableTracker

Started by maarx1337, March 02, 2017, 12:38:35 PM

Previous topic - Next topic

maarx1337

So, in game, when you open menu "Restrict" and set their hourly slots to "Anything" or "Work" or "Joy" or "Rest" ...

... this seems to roughly correspond to Pawn.Pawn_TimetableTracker, which is a List of 24 TimeAssignmentDefs ...

... and each TimeAssignmentDef is just two bools: allowJoy and allowRest ...

... and "Work" is obvious, in this case allowJoy = false and allowRest = false, this makes sense ...

... but for "Anything" and for "Joy" and for "Rest", it seems their definitions are all the same, they are all allowJoy = true and allowRest = true ...

... but in-game there is a behavioral difference between these three options, isn't there?

Where is this difference reflected in the code? Anyone know?

maarx1337

I found a set of pseudo "enums" at TimeAssignmentDefsOf, and if I set the TimeAssignmentDefs to those specific preset values instead of manually specifying allowJoy and allowRest, the pawns behave differently, as expected.

My suspicion is that the code doesn't always refer to the bools, but rather sometimes checks against those hardcoded pseudo enums.