summaryrefslogtreecommitdiff
path: root/Library/Artifacts/3f/3f0379001bfdd763d2e68a2dc2f79e3d
blob: 1dbc77968af017c2754378985fd71e1208e9de4c (plain)
ofshex dumpascii
0000 00 00 0f 81 00 00 a7 70 00 00 00 15 00 00 10 00 00 00 00 00 32 30 31 39 2e 33 2e 36 66 31 00 fe .......p............2019.3.6f1..
0020 ff ff ff 01 02 00 00 00 0b 04 00 00 00 ff ff 66 9a 86 21 eb 14 35 98 39 dd 34 1d 51 0e c1 f3 42 ...............f..!..5.9.4.Q...B
0040 00 00 00 ed 00 00 00 02 00 00 00 00 00 00 00 37 00 00 80 ff ff ff ff 00 00 00 00 00 80 00 00 00 ...............7................
0060 00 00 00 00 00 00 00 01 00 01 00 a6 03 00 80 b2 01 00 80 04 00 00 00 01 00 00 00 01 00 00 00 00 ................................
0080 00 00 00 00 00 00 00 01 00 01 00 0d 00 00 00 45 04 00 80 0c 00 00 00 02 00 00 00 01 00 00 00 00 ...............E................
00a0 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 03 00 00 00 01 00 80 00 00 ...............#................
00c0 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 04 00 00 00 01 00 80 00 00 ...............,................
00e0 00 00 00 00 00 00 00 01 00 01 00 35 00 00 00 61 04 00 80 0c 00 00 00 05 00 00 00 01 00 00 00 00 ...........5...a................
0100 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 06 00 00 00 01 00 80 00 00 ...............#................
0120 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 07 00 00 00 01 00 80 00 00 ...............,................
0140 00 00 00 00 00 00 00 01 00 01 00 86 02 00 80 72 04 00 80 0c 00 00 00 08 00 00 00 01 00 00 00 00 ...............r................
0160 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 09 00 00 00 01 00 80 00 00 ...............#................
0180 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 0a 00 00 00 01 00 80 00 00 ...............,................
01a0 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ab 01 00 80 ff ff ff ff 0b 00 00 00 01 80 08 00 00 ...........H....................
01c0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 0c 00 00 00 01 40 08 00 00 ...........1...1............@...
01e0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 0d 00 00 00 01 00 08 00 00 ................................
0200 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 0e 00 00 00 01 00 08 00 00 ...........Q...j................
0220 00 00 00 00 00 00 00 01 00 01 00 f1 00 00 80 4a 00 00 00 ff ff ff ff 0f 00 00 00 00 c0 00 00 00 ...............J................
0240 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 10 00 00 00 00 80 00 00 00 ...........1...1................
0260 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 11 00 00 00 00 00 00 00 00 ................................
0280 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a 00 00 80 ff ff ff ff 12 00 00 00 00 80 00 00 00 ...............j................
02a0 00 00 00 00 00 00 00 01 00 04 00 5c 00 00 00 9b 00 00 80 ff ff ff ff 13 00 00 00 00 80 00 00 00 ...........\....................
02c0 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 72 00 00 00 ff ff ff ff 14 00 00 00 00 80 00 00 00 ...........H...r................
02e0 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 15 00 00 00 01 40 00 00 00 ...........1...1............@...
0300 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 16 00 00 00 01 00 00 00 00 ................................
0320 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 17 00 00 00 01 00 00 00 00 ...........Q...j................
0340 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 77 00 00 00 ff ff ff ff 18 00 00 00 00 80 00 00 00 ...........H...w................
0360 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 19 00 00 00 01 40 00 00 00 ...........1...1............@...
0380 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 1a 00 00 00 01 00 00 00 00 ................................
03a0 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 1b 00 00 00 01 00 00 00 00 ...........Q...j................
03c0 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 80 00 00 00 ff ff ff ff 1c 00 00 00 00 80 00 00 00 ...........H....................
03e0 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 1d 00 00 00 01 40 00 00 00 ...........1...1............@...
0400 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 1e 00 00 00 01 00 00 00 00 ................................
0420 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 1f 00 00 00 01 00 00 00 00 ...........Q...j................
0440 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a 03 00 80 0c 00 00 00 20 00 00 00 00 00 00 00 00 ...........y....................
0460 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 23 00 00 00 04 00 00 00 21 00 00 00 01 00 80 00 00 ...............#.......!........
0480 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 2c 00 00 00 08 00 00 00 22 00 00 00 01 00 80 00 00 ...............,......."........
04a0 00 00 00 00 00 00 00 01 00 01 00 11 03 00 80 85 00 00 00 ff ff ff ff 23 00 00 00 01 40 08 00 00 .......................#....@...
04c0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 24 00 00 00 01 00 08 00 00 ...........1...1.......$........
04e0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 25 00 00 00 01 00 08 00 00 .......................%........
0500 00 00 00 00 00 00 00 01 00 03 00 2e 03 00 80 6a 00 00 80 08 00 00 00 26 00 00 00 01 00 08 00 00 ...............j.......&........
0520 00 00 00 00 00 00 00 01 00 01 00 d5 03 00 80 93 00 00 00 ff ff ff ff 27 00 00 00 00 80 00 00 00 .......................'........
0540 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 28 00 00 00 00 c0 00 00 00 ...........1...1.......(........
0560 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 29 00 00 00 00 00 00 00 00 .......................)........
0580 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a 00 00 80 ff ff ff ff 2a 00 00 00 00 80 00 00 00 ...............j.......*........
05a0 00 00 00 00 00 00 00 01 00 04 00 48 03 00 80 9b 00 00 80 ff ff ff ff 2b 00 00 00 00 80 00 00 00 ...........H...........+........
05c0 00 00 00 00 00 00 00 01 00 05 01 31 00 00 80 31 00 00 80 ff ff ff ff 2c 00 00 00 01 40 00 00 00 ...........1...1.......,....@...
05e0 00 00 00 00 00 00 00 01 00 06 00 de 00 00 80 1b 03 00 80 04 00 00 00 2d 00 00 00 01 00 00 00 00 .......................-........
0600 00 00 00 00 00 00 00 01 00 06 00 51 00 00 80 6a 00 00 80 01 00 00 00 2e 00 00 00 01 00 00 00 00 ...........Q...j................
0620 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a 03 00 80 0c 00 00 00 2f 00 00 00 00 00 00 00 00 ...........y.........../........
0640 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 23 00 00 00 04 00 00 00 30 00 00 00 01 00 80 00 00 ...............#.......0........
0660 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 2c 00 00 00 08 00 00 00 31 00 00 00 01 00 80 00 00 ...............,.......1........
0680 00 00 00 00 00 00 00 01 00 01 00 20 03 00 80 a7 00 00 00 02 00 00 00 32 00 00 00 00 40 00 00 00 .......................2....@...
06a0 00 00 00 00 00 00 00 01 00 01 00 be 02 00 80 b6 00 00 00 0c 00 00 00 33 00 00 00 00 40 00 00 00 .......................3....@...
06c0 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 34 00 00 00 01 00 80 00 00 ...............#.......4........
06e0 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 35 00 00 00 01 00 80 00 00 ...............,.......5........
0700 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 bb 00 00 00 ff ff ff ff 36 00 00 00 01 80 00 00 00 ...........H...........6........
0720 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 37 00 00 00 01 40 00 00 00 ...........1...1.......7....@...
0740 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 38 00 00 00 01 00 00 00 00 .......................8........
0760 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 39 00 00 00 01 00 00 00 00 ...........Q...j.......9........
0780 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 c6 00 00 00 ff ff ff ff 3a 00 00 00 01 80 00 00 00 ...........H...........:........
07a0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 3b 00 00 00 01 40 00 00 00 ...........1...1.......;....@...
07c0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 3c 00 00 00 01 00 00 00 00 .......................<........
07e0 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 3d 00 00 00 01 00 00 00 00 ...........Q...j.......=........
0800 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 d8 00 00 00 ff ff ff ff 3e 00 00 00 01 80 00 00 00 ...........H...........>........
0820 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 3f 00 00 00 01 40 00 00 00 ...........1...1.......?....@...
0840 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 40 00 00 00 01 00 00 00 00 .......................@........
0860 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 41 00 00 00 01 00 00 00 00 ...........Q...j.......A........
0880 00 00 00 00 00 00 00 4d 6f 6e 6f 49 6d 70 6f 72 74 65 72 00 50 50 74 72 3c 45 64 69 74 6f 72 45 .......MonoImporter.PPtr<EditorE
08a0 78 74 65 6e 73 69 6f 6e 3e 00 6d 5f 46 69 6c 65 49 44 00 6d 5f 50 61 74 68 49 44 00 50 50 74 72 xtension>.m_FileID.m_PathID.PPtr
08c0 3c 50 72 65 66 61 62 49 6e 73 74 61 6e 63 65 3e 00 6d 5f 45 78 74 65 72 6e 61 6c 4f 62 6a 65 63 <PrefabInstance>.m_ExternalObjec
08e0 74 73 00 53 6f 75 72 63 65 41 73 73 65 74 49 64 65 6e 74 69 66 69 65 72 00 74 79 70 65 00 61 73 ts.SourceAssetIdentifier.type.as
0900 73 65 6d 62 6c 79 00 6e 61 6d 65 00 6d 5f 55 73 65 64 46 69 6c 65 49 44 73 00 6d 5f 44 65 66 61 sembly.name.m_UsedFileIDs.m_Defa
0920 75 6c 74 52 65 66 65 72 65 6e 63 65 73 00 65 78 65 63 75 74 69 6f 6e 4f 72 64 65 72 00 69 63 6f ultReferences.executionOrder.ico
0940 6e 00 6d 5f 55 73 65 72 44 61 74 61 00 6d 5f 41 73 73 65 74 42 75 6e 64 6c 65 4e 61 6d 65 00 6d n.m_UserData.m_AssetBundleName.m
0960 5f 41 73 73 65 74 42 75 6e 64 6c 65 56 61 72 69 61 6e 74 00 00 00 00 00 73 00 00 00 00 ff ff a3 _AssetBundleVariant.....s.......
0980 47 f1 d7 dc 8f 5a 35 36 a0 3a 21 40 69 c1 4a 2a 00 00 00 81 00 00 00 05 00 00 00 15 01 00 80 37 G....Z56.:!@i.J*...............7
09a0 00 00 80 ff ff ff ff 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 01 00 01 00 a6 03 00 80 b2 ................................
09c0 01 00 80 04 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 45 ...............................E
09e0 04 00 80 0c 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0a00 00 00 00 04 00 00 00 03 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0a20 00 00 00 08 00 00 00 04 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 28 00 00 00 61 ...........................(...a
0a40 04 00 80 0c 00 00 00 05 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0a60 00 00 00 04 00 00 00 06 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0a80 00 00 00 08 00 00 00 07 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 86 02 00 80 72 ...............................r
0aa0 04 00 80 0c 00 00 00 08 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0ac0 00 00 00 04 00 00 00 09 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0ae0 00 00 00 08 00 00 00 0a 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ab ...........................H....
0b00 01 00 80 ff ff ff ff 0b 00 00 00 01 80 08 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0b20 00 00 80 ff ff ff ff 0c 00 00 00 01 40 08 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ............@...................
0b40 03 00 80 04 00 00 00 0d 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a ...........................Q...j
0b60 00 00 80 01 00 00 00 0e 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ea ...........................H....
0b80 01 00 80 ff ff ff ff 0f 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0ba0 00 00 80 ff ff ff ff 10 00 00 00 01 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ............@...................
0bc0 03 00 80 04 00 00 00 11 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a ...........................Q...j
0be0 00 00 80 01 00 00 00 12 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 f1 00 00 80 3d ...............................=
0c00 00 00 00 ff ff ff ff 13 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0c20 00 00 80 ff ff ff ff 14 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ................................
0c40 03 00 80 04 00 00 00 15 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a ...............................j
0c60 00 00 80 ff ff ff ff 16 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 04 00 48 03 00 80 9b ...........................H....
0c80 00 00 80 ff ff ff ff 17 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 05 01 31 00 00 80 31 ...........................1...1
0ca0 00 00 80 ff ff ff ff 18 00 00 00 01 40 00 00 00 00 00 00 00 00 00 00 01 00 06 00 de 00 00 80 1b ............@...................
0cc0 03 00 80 04 00 00 00 19 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 06 00 51 00 00 80 6a ...........................Q...j
0ce0 00 00 80 01 00 00 00 1a 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a ...........................y....
0d00 03 00 80 0c 00 00 00 1b 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 16 ................................
0d20 00 00 00 04 00 00 00 1c 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 1f ................................
0d40 00 00 00 08 00 00 00 1d 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 79 02 00 80 51 ...........................y...Q
0d60 00 00 00 0c 00 00 00 1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0d80 00 00 00 04 00 00 00 1f 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0da0 00 00 00 08 00 00 00 20 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 de 00 00 80 58 ...............................X
0dc0 00 00 00 04 00 00 00 21 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 69 .......!...................H...i
0de0 00 00 00 ff ff ff ff 22 00 00 00 10 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ......."...................1...1
0e00 00 00 80 ff ff ff ff 23 00 00 00 11 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b .......#....@...................
0e20 03 00 80 04 00 00 00 24 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a .......$...................Q...j
0e40 00 00 80 01 00 00 00 25 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 75 .......%...................H...u
0e60 00 00 00 ff ff ff ff 26 00 00 00 10 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 .......&...................1...1
0e80 00 00 80 ff ff ff ff 27 00 00 00 11 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b .......'....@...................
0ea0 03 00 80 04 00 00 00 28 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a .......(...................Q...j
0ec0 00 00 80 01 00 00 00 29 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 50 50 74 72 3c 45 64 69 74 .......)...............PPtr<Edit
0ee0 6f 72 45 78 74 65 6e 73 69 6f 6e 3e 00 6d 5f 46 69 6c 65 49 44 00 6d 5f 50 61 74 68 49 44 00 50 orExtension>.m_FileID.m_PathID.P
0f00 50 74 72 3c 50 72 65 66 61 62 49 6e 73 74 61 6e 63 65 3e 00 6d 5f 44 65 66 61 75 6c 74 52 65 66 Ptr<PrefabInstance>.m_DefaultRef
0f20 65 72 65 6e 63 65 73 00 6d 5f 49 63 6f 6e 00 6d 5f 45 78 65 63 75 74 69 6f 6e 4f 72 64 65 72 00 erences.m_Icon.m_ExecutionOrder.
0f40 6d 5f 43 6c 61 73 73 4e 61 6d 65 00 6d 5f 4e 61 6d 65 73 70 61 63 65 00 00 00 00 00 02 00 00 00 m_ClassName.m_Namespace.........
0f60 03 00 00 00 00 00 00 00 00 00 00 00 5c 00 00 00 00 00 00 00 e0 79 af 00 00 00 00 00 60 00 00 00 ............\........y......`...
0f80 10 97 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 e0 79 af 00 00 00 00 00 00 00 00 00 .....................y..........
1040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1080 00 00 00 00 00 00 00 00 11 00 00 00 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 79 00 00 00 ............InputStateHistory...
10a0 7a 96 00 00 75 73 69 6e 67 20 53 79 73 74 65 6d 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e z...using.System;..using.System.
10c0 43 6f 6c 6c 65 63 74 69 6f 6e 73 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 43 6f 6c 6c 65 Collections;..using.System.Colle
10e0 63 74 69 6f 6e 73 2e 47 65 6e 65 72 69 63 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 4c 69 ctions.Generic;..using.System.Li
1100 6e 71 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 52 75 6e 74 69 6d 65 2e 49 6e 74 65 72 6f nq;..using.System.Runtime.Intero
1120 70 53 65 72 76 69 63 65 73 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 2e 43 6f 6c 6c 65 63 74 69 pServices;..using.Unity.Collecti
1140 6f 6e 73 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 2e 43 6f 6c 6c 65 63 74 69 6f 6e 73 2e 4c 6f ons;..using.Unity.Collections.Lo
1160 77 4c 65 76 65 6c 2e 55 6e 73 61 66 65 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e wLevel.Unsafe;..using.UnityEngin
1180 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e e.InputSystem;..using.UnityEngin
11a0 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 4c 6f 77 4c 65 76 65 6c 3b 0d 0a 75 73 69 6e 67 20 55 e.InputSystem.LowLevel;..using.U
11c0 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 55 74 69 6c 69 74 69 65 73 nityEngine.InputSystem.Utilities
11e0 3b 0d 0a 0d 0a 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 73 68 6f 75 6c 64 20 74 68 69 73 20 65 6e 75 ;....////REVIEW:.should.this.enu
1200 6d 65 72 61 74 65 20 2a 62 61 63 6b 77 61 72 64 73 2a 20 69 6e 20 74 69 6d 65 20 72 61 74 68 65 merate.*backwards*.in.time.rathe
1220 72 20 74 68 61 6e 20 2a 66 6f 72 77 61 72 64 73 2a 3f 0d 0a 0d 0a 2f 2f 2f 2f 54 4f 44 4f 3a 20 r.than.*forwards*?....////TODO:.
1240 61 6c 6c 6f 77 20 63 6f 72 72 65 6c 61 74 69 6e 67 20 68 69 73 74 6f 72 79 20 74 6f 20 66 72 61 allow.correlating.history.to.fra
1260 6d 65 73 2f 75 70 64 61 74 65 73 0d 0a 0d 0a 2f 2f 2f 2f 54 4f 44 4f 3a 20 61 64 64 20 61 62 69 mes/updates....////TODO:.add.abi
1280 6c 69 74 79 20 74 6f 20 67 72 6f 77 20 73 75 63 68 20 74 68 61 74 20 79 6f 75 20 63 61 6e 20 73 lity.to.grow.such.that.you.can.s
12a0 65 74 20 69 74 20 74 6f 20 65 2e 67 2e 20 72 65 63 6f 72 64 20 75 70 20 74 6f 20 34 20 73 65 63 et.it.to.e.g..record.up.to.4.sec
12c0 6f 6e 64 73 20 6f 66 20 68 69 73 74 6f 72 79 20 61 6e 64 20 69 74 20 77 69 6c 6c 20 61 75 74 6f onds.of.history.and.it.will.auto
12e0 6d 61 74 69 63 61 6c 6c 79 20 6b 65 65 70 20 74 68 65 20 62 75 66 66 65 72 20 73 69 7a 65 20 62 matically.keep.the.buffer.size.b
1300 6f 75 6e 64 65 64 0d 0a 0d 0a 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 73 68 6f 75 6c 64 20 77 65 20 ounded....////REVIEW:.should.we.
1320 61 6c 69 67 6e 20 74 68 65 20 65 78 74 72 61 20 6d 65 6d 6f 72 79 20 6f 6e 20 61 20 34 20 62 79 align.the.extra.memory.on.a.4.by
1340 74 65 20 62 6f 75 6e 64 61 72 79 3f 0d 0a 0d 0a 6e 61 6d 65 73 70 61 63 65 20 55 6e 69 74 79 45 te.boundary?....namespace.UnityE
1360 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 4c 6f 77 4c 65 76 65 6c 0d 0a 7b 0d 0a 20 ngine.InputSystem.LowLevel..{...
1380 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f 2f 20 52 65 63 6f 72 64 ...///.<summary>......///.Record
13a0 20 61 20 68 69 73 74 6f 72 79 20 6f 66 20 73 74 61 74 65 20 63 68 61 6e 67 65 73 20 61 70 70 6c .a.history.of.state.changes.appl
13c0 69 65 64 20 74 6f 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 63 6f 6e 74 72 6f 6c 73 2e 0d 0a 20 20 ied.to.one.or.more.controls.....
13e0 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 ..///.</summary>......///.<remar
1400 6b 73 3e 0d 0a 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 63 6c 61 73 73 20 6d 61 6b 65 73 20 69 74 ks>......///.This.class.makes.it
1420 20 65 61 73 79 20 74 6f 20 74 72 61 63 6b 20 69 6e 70 75 74 20 76 61 6c 75 65 73 20 6f 76 65 72 .easy.to.track.input.values.over
1440 20 74 69 6d 65 2e 20 49 74 20 77 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 72 65 74 .time..It.will.automatically.ret
1460 61 69 6e 20 69 6e 70 75 74 20 73 74 61 74 65 20 75 70 20 74 6f 20 61 20 67 69 76 65 6e 0d 0a 20 ain.input.state.up.to.a.given...
1480 20 20 20 2f 2f 2f 20 6d 61 78 69 6d 75 6d 20 68 69 73 74 6f 72 79 20 64 65 70 74 68 20 28 3c 73 ...///.maximum.history.depth.(<s
14a0 65 65 20 63 72 65 66 3d 22 68 69 73 74 6f 72 79 44 65 70 74 68 22 2f 3e 29 2e 20 57 68 65 6e 20 ee.cref="historyDepth"/>)..When.
14c0 74 68 65 20 68 69 73 74 6f 72 79 20 69 73 20 66 75 6c 6c 2c 20 69 74 20 77 69 6c 6c 20 73 74 61 the.history.is.full,.it.will.sta
14e0 72 74 20 6f 76 65 72 77 72 69 74 69 6e 67 20 74 68 65 20 6f 6c 64 65 73 74 0d 0a 20 20 20 20 2f rt.overwriting.the.oldest....../
1500 2f 2f 20 65 6e 74 72 79 20 65 61 63 68 20 74 69 6d 65 20 61 20 6e 65 77 20 68 69 73 74 6f 72 79 //.entry.each.time.a.new.history
1520 20 72 65 63 6f 72 64 20 69 73 20 72 65 63 65 69 76 65 64 2e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 .record.is.received.......///...
1540 20 20 20 2f 2f 2f 20 54 68 65 20 63 6c 61 73 73 20 6c 69 73 74 65 6e 73 20 74 6f 20 63 68 61 6e ...///.The.class.listens.to.chan
1560 67 65 73 20 6f 6e 20 74 68 65 20 67 69 76 65 6e 20 63 6f 6e 74 72 6f 6c 73 20 62 79 20 61 64 64 ges.on.the.given.controls.by.add
1580 69 6e 67 20 63 68 61 6e 67 65 20 6d 6f 6e 69 74 6f 72 73 20 28 3c 73 65 65 20 63 72 65 66 3d 22 ing.change.monitors.(<see.cref="
15a0 49 49 6e 70 75 74 53 74 61 74 65 43 68 61 6e 67 65 4d 6f 6e 69 74 6f 72 22 2f 3e 29 0d 0a 20 20 IInputStateChangeMonitor"/>)....
15c0 20 20 2f 2f 2f 20 74 6f 20 65 61 63 68 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 2f 2f 2f 0d ..///.to.each.control.......///.
15e0 0a 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 .....///.<example>......///.<cod
1600 65 3e 0d 0a 20 20 20 20 2f 2f 2f 20 2f 2f 20 54 72 61 63 6b 20 61 6c 6c 20 73 74 69 63 6b 20 63 e>......///.//.Track.all.stick.c
1620 6f 6e 74 72 6f 6c 73 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 20 2f 2f 2f 20 ontrols.in.the.system.......///.
1640 76 61 72 20 68 69 73 74 6f 72 79 20 3d 20 6e 65 77 20 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 var.history.=.new.InputStateHist
1660 6f 72 79 26 6c 74 3b 56 65 63 74 6f 72 32 26 67 74 3b 28 22 2a 2f 26 6c 74 3b 53 74 69 63 6b 26 ory&lt;Vector2&gt;("*/&lt;Stick&
1680 67 74 3b 22 29 3b 0d 0a 20 20 20 20 2f 2f 2f 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 63 6f 6e gt;");......///.foreach.(var.con
16a0 74 72 6f 6c 20 69 6e 20 68 69 73 74 6f 72 79 2e 63 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 2f trol.in.history.controls)....../
16c0 2f 2f 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 43 61 70 74 75 72 69 6e 67 20 69 6e 70 75 //.....Debug.Log("Capturing.inpu
16e0 74 20 6f 6e 20 22 20 2b 20 63 6f 6e 74 72 6f 6c 29 3b 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 t.on.".+.control);......///.....
1700 20 2f 2f 2f 20 2f 2f 20 53 74 61 72 74 20 63 61 70 74 75 72 69 6e 67 2e 0d 0a 20 20 20 20 2f 2f .///.//.Start.capturing.......//
1720 2f 20 68 69 73 74 6f 72 79 2e 53 74 61 72 74 52 65 63 6f 72 64 69 6e 67 28 29 3b 0d 0a 20 20 20 /.history.StartRecording();.....
1740 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 2f 2f 20 50 65 72 66 6f 72 6d 20 61 20 63 6f 75 70 6c .///......///.//.Perform.a.coupl
1760 65 20 61 72 74 69 66 69 63 69 61 6c 20 76 61 6c 75 65 20 63 68 61 6e 67 65 73 2e 0d 0a 20 20 20 e.artificial.value.changes......
1780 20 2f 2f 2f 20 47 61 6d 65 70 61 64 2e 63 75 72 72 65 6e 74 2e 6c 65 66 74 53 74 69 63 6b 2e 51 .///.Gamepad.current.leftStick.Q
17a0 75 65 75 65 56 61 6c 75 65 43 68 61 6e 67 65 28 6e 65 77 20 56 65 63 74 6f 72 32 28 30 2e 31 32 ueueValueChange(new.Vector2(0.12
17c0 33 66 2c 20 30 2e 32 33 34 66 29 29 3b 0d 0a 20 20 20 20 2f 2f 2f 20 47 61 6d 65 70 61 64 2e 63 3f,.0.234f));......///.Gamepad.c
17e0 75 72 72 65 6e 74 2e 6c 65 66 74 53 74 69 63 6b 2e 51 75 65 75 65 56 61 6c 75 65 43 68 61 6e 67 urrent.leftStick.QueueValueChang
1800 65 28 6e 65 77 20 56 65 63 74 6f 72 32 28 30 2e 32 33 34 66 2c 20 30 2e 33 34 35 66 29 29 3b 0d e(new.Vector2(0.234f,.0.345f));.
1820 0a 20 20 20 20 2f 2f 2f 20 47 61 6d 65 70 61 64 2e 63 75 72 72 65 6e 74 2e 6c 65 66 74 53 74 69 .....///.Gamepad.current.leftSti
1840 63 6b 2e 51 75 65 75 65 56 61 6c 75 65 43 68 61 6e 67 65 28 6e 65 77 20 56 65 63 74 6f 72 32 28 ck.QueueValueChange(new.Vector2(
1860 30 2e 33 34 35 66 2c 20 30 2e 34 35 36 66 29 29 3b 0d 0a 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 0.345f,.0.456f));......///.Input
1880 53 79 73 74 65 6d 2e 55 70 64 61 74 65 28 29 3b 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f System.Update();......///....../
18a0 2f 2f 20 2f 2f 20 45 76 65 72 79 20 76 61 6c 75 65 20 63 68 61 6e 67 65 20 77 69 6c 6c 20 62 65 //.//.Every.value.change.will.be
18c0 20 76 69 73 69 62 6c 65 20 69 6e 20 74 68 65 20 68 69 73 74 6f 72 79 2e 0d 0a 20 20 20 20 2f 2f .visible.in.the.history.......//
18e0 2f 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 72 65 63 6f 72 64 20 69 6e 20 68 69 73 74 6f 72 79 /.foreach.(var.record.in.history
1900 29 0d 0a 20 20 20 20 2f 2f 2f 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 24 22 7b 72 65 63 6f )......///.....Debug.Log($"{reco
1920 72 64 2e 63 6f 6e 74 72 6f 6c 7d 20 63 68 61 6e 67 65 64 20 76 61 6c 75 65 20 74 6f 20 7b 72 65 rd.control}.changed.value.to.{re
1940 63 6f 72 64 2e 52 65 61 64 56 61 6c 75 65 28 29 7d 22 29 3b 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 cord.ReadValue()}");......///...
1960 20 20 20 2f 2f 2f 20 2f 2f 20 48 69 73 74 6f 72 69 65 73 20 61 6c 6c 6f 63 61 74 65 20 75 6e 6d ...///.//.Histories.allocate.unm
1980 61 6e 61 67 65 64 20 6d 65 6d 6f 72 79 20 61 6e 64 20 6d 75 73 74 20 62 65 20 64 69 73 70 6f 73 anaged.memory.and.must.be.dispos
19a0 65 64 20 6f 66 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 6e 6f 74 20 6c 65 61 6b 2e 0d 0a 20 20 20 ed.of.in.order.to.not.leak......
19c0 20 2f 2f 2f 20 68 69 73 74 6f 72 79 2e 44 69 73 70 6f 73 65 28 29 3b 0d 0a 20 20 20 20 2f 2f 2f .///.history.Dispose();......///
19e0 20 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 .</code>......///.</example>....
1a00 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 70 75 62 6c 69 63 20 63 6c 61 ..///.</remarks>......public.cla
1a20 73 73 20 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 79 20 3a 20 49 44 69 73 70 6f 73 61 62 ss.InputStateHistory.:.IDisposab
1a40 6c 65 2c 20 49 45 6e 75 6d 65 72 61 62 6c 65 3c 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 le,.IEnumerable<InputStateHistor
1a60 79 2e 52 65 63 6f 72 64 3e 2c 20 49 49 6e 70 75 74 53 74 61 74 65 43 68 61 6e 67 65 4d 6f 6e 69 y.Record>,.IInputStateChangeMoni
1a80 74 6f 72 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 63 6f 6e 73 tor......{..........private.cons
1aa0 74 20 69 6e 74 20 6b 44 65 66 61 75 6c 74 48 69 73 74 6f 72 79 53 69 7a 65 20 3d 20 31 32 38 3b t.int.kDefaultHistorySize.=.128;
1ac0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 ............///.<summary>.......
1ae0 20 20 20 2f 2f 2f 20 54 6f 74 61 6c 20 6e 75 6d 62 65 72 20 6f 66 20 73 74 61 74 65 20 72 65 63 ...///.Total.number.of.state.rec
1b00 6f 72 64 73 20 63 75 72 72 65 6e 74 6c 79 20 63 61 70 74 75 72 65 64 20 69 6e 20 74 68 65 20 68 ords.currently.captured.in.the.h
1b20 69 73 74 6f 72 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d istory...........///.</summary>.
1b40 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 4e 75 6d 62 65 72 20 6f 66 20 72 65 .........///.<value>Number.of.re
1b60 63 6f 72 64 73 20 69 6e 20 74 68 65 20 63 6f 6c 6c 65 63 74 69 6f 6e 2e 3c 2f 76 61 6c 75 65 3e cords.in.the.collection.</value>
1b80 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 ..........///.<remarks>.........
1ba0 20 2f 2f 2f 20 54 68 69 73 20 77 69 6c 6c 20 61 6c 77 61 79 73 20 62 65 20 61 74 20 6d 6f 73 74 .///.This.will.always.be.at.most
1bc0 20 3c 73 65 65 20 63 72 65 66 3d 22 68 69 73 74 6f 72 79 44 65 70 74 68 22 2f 3e 2e 0d 0a 20 20 .<see.cref="historyDepth"/>.....
1be0 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ......///.</remarks>..........//
1c00 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 68 69 73 74 6f 72 79 44 65 70 74 68 22 2f 3e /.<seealso.cref="historyDepth"/>
1c20 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 63 ..........///.<seealso.cref="Rec
1c40 6f 72 64 53 74 61 74 65 43 68 61 6e 67 65 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2c 49 6e 70 75 ordStateChange(InputControl,Inpu
1c60 74 45 76 65 6e 74 50 74 72 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 6e tEventPtr)"/>..........public.in
1c80 74 20 43 6f 75 6e 74 20 3d 3e 20 6d 5f 52 65 63 6f 72 64 43 6f 75 6e 74 3b 0d 0a 0d 0a 20 20 20 t.Count.=>.m_RecordCount;.......
1ca0 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .....///.<summary>..........///.
1cc0 43 75 72 72 65 6e 74 20 76 65 72 73 69 6f 6e 20 73 74 61 6d 70 2e 20 45 76 65 72 79 20 74 69 6d Current.version.stamp..Every.tim
1ce0 65 20 61 20 72 65 63 6f 72 64 20 69 73 20 73 74 6f 72 65 64 20 69 6e 20 74 68 65 20 68 69 73 74 e.a.record.is.stored.in.the.hist
1d00 6f 72 79 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 69 73 20 69 73 20 69 6e 63 72 65 6d ory,..........///.this.is.increm
1d20 65 6e 74 65 64 20 62 79 20 6f 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d ented.by.one...........///.</sum
1d40 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 56 65 72 73 69 6f mary>..........///.<value>Versio
1d60 6e 20 73 74 61 6d 70 20 74 68 61 74 20 69 6e 64 69 63 61 74 65 73 20 74 68 65 20 6e 75 6d 62 65 n.stamp.that.indicates.the.numbe
1d80 72 20 6f 66 20 6d 75 74 61 74 69 6f 6e 73 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 r.of.mutations.</value>.........
1da0 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 63 6f 72 64 53 74 61 74 65 43 .///.<seealso.cref="RecordStateC
1dc0 68 61 6e 67 65 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2c 49 6e 70 75 74 45 76 65 6e 74 50 74 72 hange(InputControl,InputEventPtr
1de0 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 75 69 6e 74 20 76 65 72 73 69 6f )"/>..........public.uint.versio
1e00 6e 20 3d 3e 20 6d 5f 43 75 72 72 65 6e 74 56 65 72 73 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 n.=>.m_CurrentVersion;..........
1e20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4d 61 78 ..///.<summary>..........///.Max
1e40 69 6d 75 6d 20 6e 75 6d 62 65 72 20 6f 66 20 72 65 63 6f 72 64 73 20 74 68 61 74 20 63 61 6e 20 imum.number.of.records.that.can.
1e60 62 65 20 72 65 63 6f 72 64 65 64 20 69 6e 20 74 68 65 20 68 69 73 74 6f 72 79 2e 0d 0a 20 20 20 be.recorded.in.the.history......
1e80 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .....///.</summary>..........///
1ea0 20 3c 76 61 6c 75 65 3e 55 70 70 65 72 20 6c 69 6d 69 74 20 6f 6e 20 6e 75 6d 62 65 72 20 6f 66 .<value>Upper.limit.on.number.of
1ec0 20 72 65 63 6f 72 64 73 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c .records.</value>..........///.<
1ee0 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f exception.cref="ArgumentExceptio
1f00 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 76 61 6c 75 65 22 2f 3e 20 69 73 20 6e n"><paramref.name="value"/>.is.n
1f20 65 67 61 74 69 76 65 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f egative.</exception>..........//
1f40 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 20 66 69 78 65 64 /.<remarks>..........///.A.fixed
1f60 20 73 69 7a 65 20 6d 65 6d 6f 72 79 20 62 6c 6f 63 6b 20 6f 66 20 75 6e 6d 61 6e 61 67 65 64 20 .size.memory.block.of.unmanaged.
1f80 6d 65 6d 6f 72 79 20 77 69 6c 6c 20 62 65 20 61 6c 6c 6f 63 61 74 65 64 20 74 6f 20 73 74 6f 72 memory.will.be.allocated.to.stor
1fa0 65 20 68 69 73 74 6f 72 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 65 63 6f 72 64 73 2e 20 e.history..........///.records..
1fc0 54 68 69 73 20 70 72 6f 70 65 72 74 79 20 64 65 74 65 72 6d 69 6e 65 73 20 54 4f 44 4f 0d 0a 20 This.property.determines.TODO...
1fe0 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 .......///.</remarks>..........p
2000 75 62 6c 69 63 20 69 6e 74 20 68 69 73 74 6f 72 79 44 65 70 74 68 0d 0a 20 20 20 20 20 20 20 20 ublic.int.historyDepth..........
2020 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 6d 5f 48 69 73 74 6f 72 79 44 {..............get.=>.m_HistoryD
2040 65 70 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 epth;..............set..........
2060 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 6c 75 65 ....{..................if.(value
2080 20 3c 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 .<.0)......................throw
20a0 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 22 48 69 73 74 6f 72 79 20 .new.ArgumentException("History.
20c0 64 65 70 74 68 20 63 61 6e 6e 6f 74 20 62 65 20 6e 65 67 61 74 69 76 65 22 2c 20 6e 61 6d 65 6f depth.cannot.be.negative",.nameo
20e0 66 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 f(value));..................if.(
2100 6d 5f 52 65 63 6f 72 64 42 75 66 66 65 72 2e 49 73 43 72 65 61 74 65 64 29 0d 0a 20 20 20 20 20 m_RecordBuffer.IsCreated).......
2120 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 4e 6f 74 49 6d 70 6c ...............throw.new.NotImpl
2140 65 6d 65 6e 74 65 64 45 78 63 65 70 74 69 6f 6e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ementedException();.............
2160 20 20 20 20 20 6d 5f 48 69 73 74 6f 72 79 44 65 70 74 68 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 .....m_HistoryDepth.=.value;....
2180 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 ..........}..........}..........
21a0 20 20 70 75 62 6c 69 63 20 69 6e 74 20 65 78 74 72 61 4d 65 6d 6f 72 79 50 65 72 52 65 63 6f 72 ..public.int.extraMemoryPerRecor
21c0 64 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e d..........{..............get.=>
21e0 20 6d 5f 45 78 74 72 61 4d 65 6d 6f 72 79 50 65 72 52 65 63 6f 72 64 3b 0d 0a 20 20 20 20 20 20 .m_ExtraMemoryPerRecord;........
2200 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 ......set..............{........
2220 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 6c 75 65 20 3c 20 30 29 0d 0a 20 20 20 20 20 20 ..........if.(value.<.0)........
2240 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 ..............throw.new.Argument
2260 45 78 63 65 70 74 69 6f 6e 28 22 4d 65 6d 6f 72 79 20 73 69 7a 65 20 63 61 6e 6e 6f 74 20 62 65 Exception("Memory.size.cannot.be
2280 20 6e 65 67 61 74 69 76 65 22 2c 20 6e 61 6d 65 6f 66 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 .negative",.nameof(value));.....
22a0 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 52 65 63 6f 72 64 42 75 66 66 65 72 2e .............if.(m_RecordBuffer.
22c0 49 73 43 72 65 61 74 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 IsCreated)......................
22e0 74 68 72 6f 77 20 6e 65 77 20 4e 6f 74 49 6d 70 6c 65 6d 65 6e 74 65 64 45 78 63 65 70 74 69 6f throw.new.NotImplementedExceptio
2300 6e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 45 78 74 72 61 4d 65 6d n();..................m_ExtraMem
2320 6f 72 79 50 65 72 52 65 63 6f 72 64 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 oryPerRecord.=.value;...........
2340 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 ...}..........}............publi
2360 63 20 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 65 20 75 70 64 61 74 65 4d 61 73 6b 0d 0a 20 20 c.InputUpdateType.updateMask....
2380 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 6d 5f 55 70 ......{..............get.=>.m_Up
23a0 64 61 74 65 4d 61 73 6b 20 3f 3f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 73 5f 4d 61 6e 61 67 65 dateMask.??.InputSystem.s_Manage
23c0 72 2e 75 70 64 61 74 65 4d 61 73 6b 20 26 20 7e 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 65 2e r.updateMask.&.~InputUpdateType.
23e0 45 64 69 74 6f 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 Editor;..............set........
2400 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 6c ......{..................if.(val
2420 75 65 20 3d 3d 20 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 65 2e 4e 6f 6e 65 29 0d 0a 20 20 20 ue.==.InputUpdateType.None).....
2440 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d .................throw.new.Argum
2460 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 22 27 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 65 2e 4e entException("'InputUpdateType.N
2480 6f 6e 65 27 20 69 73 20 6e 6f 74 20 61 20 76 61 6c 69 64 20 75 70 64 61 74 65 20 6d 61 73 6b 22 one'.is.not.a.valid.update.mask"
24a0 2c 20 6e 61 6d 65 6f 66 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ,.nameof(value));...............
24c0 20 20 20 6d 5f 55 70 64 61 74 65 4d 61 73 6b 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 ...m_UpdateMask.=.value;........
24e0 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 ......}..........}............pu
2500 62 6c 69 63 20 52 65 61 64 4f 6e 6c 79 41 72 72 61 79 3c 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3e blic.ReadOnlyArray<InputControl>
2520 20 63 6f 6e 74 72 6f 6c 73 20 3d 3e 20 6e 65 77 20 52 65 61 64 4f 6e 6c 79 41 72 72 61 79 3c 49 .controls.=>.new.ReadOnlyArray<I
2540 6e 70 75 74 43 6f 6e 74 72 6f 6c 3e 28 6d 5f 43 6f 6e 74 72 6f 6c 73 2c 20 30 2c 20 6d 5f 43 6f nputControl>(m_Controls,.0,.m_Co
2560 6e 74 72 6f 6c 43 6f 75 6e 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 75 ntrolCount);............public.u
2580 6e 73 61 66 65 20 52 65 63 6f 72 64 20 74 68 69 73 5b 69 6e 74 20 69 6e 64 65 78 5d 0d 0a 20 20 nsafe.Record.this[int.index]....
25a0 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 ......{..............get........
25c0 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 ......{..................if.(ind
25e0 65 78 20 3c 20 30 20 7c 7c 20 69 6e 64 65 78 20 3e 3d 20 6d 5f 52 65 63 6f 72 64 43 6f 75 6e 74 ex.<.0.||.index.>=.m_RecordCount
2600 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 )......................throw.new
2620 20 41 72 67 75 6d 65 6e 74 4f 75 74 4f 66 52 61 6e 67 65 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 .ArgumentOutOfRangeException(...
2640 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 49 6e 64 65 78 20 7b .......................$"Index.{
2660 69 6e 64 65 78 7d 20 69 73 20 6f 75 74 20 6f 66 20 72 61 6e 67 65 20 66 6f 72 20 68 69 73 74 6f index}.is.out.of.range.for.histo
2680 72 79 20 77 69 74 68 20 7b 6d 5f 52 65 63 6f 72 64 43 6f 75 6e 74 7d 20 65 6e 74 72 69 65 73 22 ry.with.{m_RecordCount}.entries"
26a0 2c 20 6e 61 6d 65 6f 66 28 69 6e 64 65 78 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ,.nameof(index));...............
26c0 20 20 20 20 20 76 61 72 20 72 65 63 6f 72 64 49 6e 64 65 78 20 3d 20 55 73 65 72 49 6e 64 65 78 .....var.recordIndex.=.UserIndex
26e0 54 6f 52 65 63 6f 72 64 49 6e 64 65 78 28 69 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ToRecordIndex(index);...........
2700 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 52 65 63 6f 72 64 28 74 68 69 73 2c 20 72 .......return.new.Record(this,.r
2720 65 63 6f 72 64 49 6e 64 65 78 2c 20 47 65 74 52 65 63 6f 72 64 28 72 65 63 6f 72 64 49 6e 64 65 ecordIndex,.GetRecord(recordInde
2740 78 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 x));..............}.............
2760 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .set..............{.............
2780 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 20 3c 20 30 20 7c 7c 20 69 6e 64 65 78 20 3e 3d 20 6d .....if.(index.<.0.||.index.>=.m
27a0 5f 52 65 63 6f 72 64 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 _RecordCount)...................
27c0 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4f 75 74 4f 66 52 61 6e 67 65 45 ...throw.new.ArgumentOutOfRangeE
27e0 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 xception(.......................
2800 20 20 20 24 22 49 6e 64 65 78 20 7b 69 6e 64 65 78 7d 20 69 73 20 6f 75 74 20 6f 66 20 72 61 6e ...$"Index.{index}.is.out.of.ran
2820 67 65 20 66 6f 72 20 68 69 73 74 6f 72 79 20 77 69 74 68 20 7b 6d 5f 52 65 63 6f 72 64 43 6f 75 ge.for.history.with.{m_RecordCou
2840 6e 74 7d 20 65 6e 74 72 69 65 73 22 2c 20 6e 61 6d 65 6f 66 28 69 6e 64 65 78 29 29 3b 0d 0a 0d nt}.entries",.nameof(index));...
2860 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 63 6f 72 64 49 6e 64 65 78 .................var.recordIndex
2880 20 3d 20 55 73 65 72 49 6e 64 65 78 54 6f 52 65 63 6f 72 64 49 6e 64 65 78 28 69 6e 64 65 78 29 .=.UserIndexToRecordIndex(index)
28a0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 77 20 52 65 63 6f 72 64 28 74 68 ;..................new.Record(th
28c0 69 73 2c 20 72 65 63 6f 72 64 49 6e 64 65 78 2c 20 47 65 74 52 65 63 6f 72 64 28 72 65 63 6f 72 is,.recordIndex,.GetRecord(recor
28e0 64 49 6e 64 65 78 29 29 2e 43 6f 70 79 46 72 6f 6d 28 76 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 dIndex)).CopyFrom(value);.......
2900 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 .......}..........}............p
2920 75 62 6c 69 63 20 41 63 74 69 6f 6e 3c 52 65 63 6f 72 64 3e 20 6f 6e 52 65 63 6f 72 64 41 64 64 ublic.Action<Record>.onRecordAdd
2940 65 64 20 7b 20 67 65 74 3b 20 73 65 74 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 ed.{.get;.set;.}..........public
2960 20 46 75 6e 63 3c 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2c 20 64 6f 75 62 6c 65 2c 20 49 6e 70 75 .Func<InputControl,.double,.Inpu
2980 74 45 76 65 6e 74 50 74 72 2c 20 62 6f 6f 6c 3e 20 6f 6e 53 68 6f 75 6c 64 52 65 63 6f 72 64 53 tEventPtr,.bool>.onShouldRecordS
29a0 74 61 74 65 43 68 61 6e 67 65 20 7b 20 67 65 74 3b 20 73 65 74 3b 20 7d 0d 0a 0d 0a 20 20 20 20 tateChange.{.get;.set;.}........
29c0 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 79 28 69 6e 74 ....public.InputStateHistory(int
29e0 20 6d 61 78 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 29 0d 0a 20 20 20 20 20 20 20 20 7b .maxStateSizeInBytes)..........{
2a00 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 61 78 53 74 61 74 65 53 69 7a 65 49 6e ..............if.(maxStateSizeIn
2a20 42 79 74 65 73 20 3c 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 Bytes.<=.0)..................thr
2a40 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 22 53 74 61 74 65 20 ow.new.ArgumentException("State.
2a60 73 69 7a 65 20 6d 75 73 74 20 62 65 20 3e 3d 20 30 22 2c 20 6e 61 6d 65 6f 66 28 6d 61 78 53 74 size.must.be.>=.0",.nameof(maxSt
2a80 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ateSizeInBytes));...............
2aa0 20 6d 5f 41 64 64 4e 65 77 43 6f 6e 74 72 6f 6c 73 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 .m_AddNewControls.=.true;.......
2ac0 20 20 20 20 20 20 20 6d 5f 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 6d 61 78 53 .......m_StateSizeInBytes.=.maxS
2ae0 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 2e 41 6c 69 67 6e 54 6f 4d 75 6c 74 69 70 6c 65 4f tateSizeInBytes.AlignToMultipleO
2b00 66 28 34 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c f(4);..........}............publ
2b20 69 63 20 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 79 28 73 74 72 69 6e 67 20 70 61 74 68 ic.InputStateHistory(string.path
2b40 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 75 73 69 6e 67 20 )..........{..............using.
2b60 28 76 61 72 20 63 6f 6e 74 72 6f 6c 73 20 3d 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 46 69 6e 64 (var.controls.=.InputSystem.Find
2b80 43 6f 6e 74 72 6f 6c 73 28 70 61 74 68 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a Controls(path))..............{..
2ba0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 6f 6e 74 72 6f 6c 73 20 3d 20 63 6f 6e ................m_Controls.=.con
2bc0 74 72 6f 6c 73 2e 54 6f 41 72 72 61 79 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 trols.ToArray();................
2be0 20 20 6d 5f 43 6f 6e 74 72 6f 6c 43 6f 75 6e 74 20 3d 20 6d 5f 43 6f 6e 74 72 6f 6c 73 2e 4c 65 ..m_ControlCount.=.m_Controls.Le
2c00 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d ngth;..............}..........}.
2c20 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 ...........public.InputStateHist
2c40 6f 72 79 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 20 ory(InputControl.control).......
2c60 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d ...{..............if.(control.==
2c80 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 .null)..................throw.ne
2ca0 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 w.ArgumentNullException(nameof(c
2cc0 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 6f 6e 74 72 ontrol));................m_Contr
2ce0 6f 6c 73 20 3d 20 6e 65 77 5b 5d 20 7b 63 6f 6e 74 72 6f 6c 7d 3b 0d 0a 20 20 20 20 20 20 20 20 ols.=.new[].{control};..........
2d00 20 20 20 20 6d 5f 43 6f 6e 74 72 6f 6c 43 6f 75 6e 74 20 3d 20 31 3b 0d 0a 20 20 20 20 20 20 20 ....m_ControlCount.=.1;.........
2d20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 53 74 61 74 65 48 .}............public.InputStateH
2d40 69 73 74 6f 72 79 28 49 45 6e 75 6d 65 72 61 62 6c 65 3c 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3e istory(IEnumerable<InputControl>
2d60 20 63 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 .controls)..........{...........
2d80 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 73 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 ...if.(controls.!=.null)........
2da0 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 6f 6e 74 72 ......{..................m_Contr
2dc0 6f 6c 73 20 3d 20 63 6f 6e 74 72 6f 6c 73 2e 54 6f 41 72 72 61 79 28 29 3b 0d 0a 20 20 20 20 20 ols.=.controls.ToArray();.......
2de0 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 6f 6e 74 72 6f 6c 43 6f 75 6e 74 20 3d 20 6d 5f 43 6f ...........m_ControlCount.=.m_Co
2e00 6e 74 72 6f 6c 73 2e 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 ntrols.Length;..............}...
2e20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 7e 49 6e 70 75 74 53 74 61 74 65 48 .......}............~InputStateH
2e40 69 73 74 6f 72 79 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 istory()..........{.............
2e60 20 44 69 73 70 6f 73 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 .Dispose();..........}..........
2e80 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 43 6c 65 61 72 28 29 0d 0a 20 20 20 20 20 20 20 20 7b ..public.void.Clear()..........{
2ea0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 48 65 61 64 49 6e 64 65 78 20 3d 20 30 3b 0d 0a ..............m_HeadIndex.=.0;..
2ec0 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 52 65 63 6f 72 64 43 6f 75 6e 74 20 3d 20 30 3b 0d 0a ............m_RecordCount.=.0;..
2ee0 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 6d 5f 43 75 72 72 65 6e 74 56 65 72 73 69 6f 6e 3b 0d ............++m_CurrentVersion;.
2f00 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 75 6e 73 .........}............public.uns
2f20 61 66 65 20 52 65 63 6f 72 64 20 41 64 64 52 65 63 6f 72 64 28 52 65 63 6f 72 64 20 72 65 63 6f afe.Record.AddRecord(Record.reco
2f40 72 64 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 rd)..........{..............var.
2f60 72 65 63 6f 72 64 50 74 72 20 3d 20 41 6c 6c 6f 63 61 74 65 52 65 63 6f 72 64 28 6f 75 74 20 76 recordPtr.=.AllocateRecord(out.v
2f80 61 72 20 69 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 65 77 52 ar.index);..............var.newR
2fa0 65 63 6f 72 64 20 3d 20 6e 65 77 20 52 65 63 6f 72 64 28 74 68 69 73 2c 20 69 6e 64 65 78 2c 20 ecord.=.new.Record(this,.index,.
2fc0 72 65 63 6f 72 64 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 77 52 65 63 6f recordPtr);..............newReco
2fe0 72 64 2e 43 6f 70 79 46 72 6f 6d 28 72 65 63 6f 72 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 rd.CopyFrom(record);............
3000 20 20 72 65 74 75 72 6e 20 6e 65 77 52 65 63 6f 72 64 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ..return.newRecord;..........}..
3020 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 53 74 61 72 74 52 65 63 6f 72 ..........public.void.StartRecor
3040 64 69 6e 67 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f ding()..........{............../
3060 2f 20 57 65 20 64 65 66 65 72 20 61 6c 6c 6f 63 61 74 69 6f 6e 20 75 6e 74 69 6c 20 77 65 20 61 /.We.defer.allocation.until.we.a
3080 63 74 75 61 6c 6c 79 20 67 65 74 20 76 61 6c 75 65 73 20 6f 6e 20 61 20 63 6f 6e 74 72 6f 6c 2e ctually.get.values.on.a.control.
30a0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 63 6f 6e ................foreach.(var.con
30c0 74 72 6f 6c 20 69 6e 20 63 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 trol.in.controls)...............
30e0 20 20 20 49 6e 70 75 74 53 74 61 74 65 2e 41 64 64 43 68 61 6e 67 65 4d 6f 6e 69 74 6f 72 28 63 ...InputState.AddChangeMonitor(c
3100 6f 6e 74 72 6f 6c 2c 20 74 68 69 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 ontrol,.this);..........}.......
3120 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 53 74 6f 70 52 65 63 6f 72 64 69 6e 67 28 29 .....public.void.StopRecording()
3140 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 ..........{..............foreach
3160 20 28 76 61 72 20 63 6f 6e 74 72 6f 6c 20 69 6e 20 63 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 .(var.control.in.controls)......
3180 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 74 61 74 65 2e 52 65 6d 6f 76 65 43 68 61 ............InputState.RemoveCha
31a0 6e 67 65 4d 6f 6e 69 74 6f 72 28 63 6f 6e 74 72 6f 6c 2c 20 74 68 69 73 29 3b 0d 0a 20 20 20 20 ngeMonitor(control,.this);......
31c0 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 75 6e 73 61 66 65 20 52 ....}............public.unsafe.R
31e0 65 63 6f 72 64 20 52 65 63 6f 72 64 53 74 61 74 65 43 68 61 6e 67 65 28 49 6e 70 75 74 43 6f 6e ecord.RecordStateChange(InputCon
3200 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 20 65 76 65 6e trol.control,.InputEventPtr.even
3220 74 50 74 72 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 tPtr)..........{..............if
3240 20 28 65 76 65 6e 74 50 74 72 2e 49 73 41 3c 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 3e 28 .(eventPtr.IsA<DeltaStateEvent>(
3260 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 4e 6f ))..................throw.new.No
3280 74 49 6d 70 6c 65 6d 65 6e 74 65 64 45 78 63 65 70 74 69 6f 6e 28 29 3b 0d 0a 0d 0a 20 20 20 20 tImplementedException();........
32a0 20 20 20 20 20 20 20 20 69 66 20 28 21 65 76 65 6e 74 50 74 72 2e 49 73 41 3c 53 74 61 74 65 45 ........if.(!eventPtr.IsA<StateE
32c0 76 65 6e 74 3e 28 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 vent>())..................throw.
32e0 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 24 22 45 76 65 6e 74 20 6d 75 new.ArgumentException($"Event.mu
3300 73 74 20 62 65 20 61 20 73 74 61 74 65 20 65 76 65 6e 74 20 62 75 74 20 69 73 20 27 7b 65 76 65 st.be.a.state.event.but.is.'{eve
3320 6e 74 50 74 72 7d 27 20 69 6e 73 74 65 61 64 22 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ntPtr}'.instead",...............
3340 20 20 20 20 20 20 20 6e 61 6d 65 6f 66 28 65 76 65 6e 74 50 74 72 29 29 3b 0d 0a 0d 0a 20 20 20 .......nameof(eventPtr));.......
3360 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 74 65 50 74 72 20 3d 20 28 62 79 74 65 2a 29 53 .........var.statePtr.=.(byte*)S
3380 74 61 74 65 45 76 65 6e 74 2e 46 72 6f 6d 28 65 76 65 6e 74 50 74 72 29 2d 3e 73 74 61 74 65 20 tateEvent.From(eventPtr)->state.
33a0 2d 20 63 6f 6e 74 72 6f 6c 2e 64 65 76 69 63 65 2e 73 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 -.control.device.stateBlock.byte
33c0 4f 66 66 73 65 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 52 65 63 6f Offset;..............return.Reco
33e0 72 64 53 74 61 74 65 43 68 61 6e 67 65 28 63 6f 6e 74 72 6f 6c 2c 20 73 74 61 74 65 50 74 72 2c rdStateChange(control,.statePtr,
3400 20 65 76 65 6e 74 50 74 72 2e 74 69 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 .eventPtr.time);..........}.....
3420 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 75 6e 73 61 66 65 20 52 65 63 6f 72 64 20 52 65 63 6f .......public.unsafe.Record.Reco
3440 72 64 53 74 61 74 65 43 68 61 6e 67 65 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 rdStateChange(InputControl.contr
3460 6f 6c 2c 20 76 6f 69 64 2a 20 73 74 61 74 65 50 74 72 2c 20 64 6f 75 62 6c 65 20 74 69 6d 65 29 ol,.void*.statePtr,.double.time)
3480 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e ..........{..............var.con
34a0 74 72 6f 6c 49 6e 64 65 78 20 3d 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 49 6e 64 65 78 4f 66 trolIndex.=.ArrayHelpers.IndexOf
34c0 52 65 66 65 72 65 6e 63 65 28 6d 5f 43 6f 6e 74 72 6f 6c 73 2c 20 63 6f 6e 74 72 6f 6c 2c 20 6d Reference(m_Controls,.control,.m
34e0 5f 43 6f 6e 74 72 6f 6c 43 6f 75 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 _ControlCount);..............if.
3500 28 63 6f 6e 74 72 6f 6c 49 6e 64 65 78 20 3d 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 (controlIndex.==.-1)............
3520 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 41 64 64 4e 65 ..{..................if.(m_AddNe
3540 77 43 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 wControls)..................{...
3560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 2e 73 ...................if.(control.s
3580 74 61 74 65 42 6c 6f 63 6b 2e 61 6c 69 67 6e 65 64 53 69 7a 65 49 6e 42 79 74 65 73 20 3e 20 6d tateBlock.alignedSizeInBytes.>.m
35a0 5f 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 _StateSizeInBytes)..............
35c0 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 ............throw.new.InvalidOpe
35e0 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rationException(................
3600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 43 61 6e 6e 6f 74 20 61 64 64 20 63 6f 6e 74 72 ..............$"Cannot.add.contr
3620 6f 6c 20 27 7b 63 6f 6e 74 72 6f 6c 7d 27 20 77 69 74 68 20 73 74 61 74 65 20 6c 61 72 67 65 72 ol.'{control}'.with.state.larger
3640 20 74 68 61 6e 20 7b 6d 5f 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 7d 20 62 79 74 65 73 .than.{m_StateSizeInBytes}.bytes
3660 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c ");......................control
3680 49 6e 64 65 78 20 3d 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 41 70 70 65 6e 64 57 69 74 68 43 Index.=.ArrayHelpers.AppendWithC
36a0 61 70 61 63 69 74 79 28 72 65 66 20 6d 5f 43 6f 6e 74 72 6f 6c 73 2c 20 72 65 66 20 6d 5f 43 6f apacity(ref.m_Controls,.ref.m_Co
36c0 6e 74 72 6f 6c 43 6f 75 6e 74 2c 20 63 6f 6e 74 72 6f 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ntrolCount,.control);...........
36e0 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a .......}..................else..
3700 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 ....................throw.new.Ar
3720 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 24 22 43 6f 6e 74 72 6f 6c 20 27 7b 63 6f 6e 74 gumentException($"Control.'{cont
3740 72 6f 6c 7d 27 20 69 73 20 6e 6f 74 20 70 61 72 74 20 6f 66 20 49 6e 70 75 74 53 74 61 74 65 48 rol}'.is.not.part.of.InputStateH
3760 69 73 74 6f 72 79 22 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 istory",........................
3780 20 20 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..nameof(control));.............
37a0 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 63 6f 72 64 50 74 72 20 .}................var.recordPtr.
37c0 3d 20 41 6c 6c 6f 63 61 74 65 52 65 63 6f 72 64 28 6f 75 74 20 76 61 72 20 69 6e 64 65 78 29 3b =.AllocateRecord(out.var.index);
37e0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 63 6f 72 64 50 74 72 2d 3e 74 69 6d 65 20 3d 20 ..............recordPtr->time.=.
3800 74 69 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 63 6f 72 64 50 74 72 2d 3e 76 65 time;..............recordPtr->ve
3820 72 73 69 6f 6e 20 3d 20 2b 2b 6d 5f 43 75 72 72 65 6e 74 56 65 72 73 69 6f 6e 3b 0d 0a 20 20 20 rsion.=.++m_CurrentVersion;.....
3840 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 74 65 42 75 66 66 65 72 50 74 72 20 3d 20 72 65 .........var.stateBufferPtr.=.re
3860 63 6f 72 64 50 74 72 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 6f 75 74 43 6f 6e 74 72 6f 6c 49 cordPtr->statePtrWithoutControlI
3880 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 43 6f 6e 74 72 6f 6c ndex;..............if.(m_Control
38a0 43 6f 75 6e 74 20 3e 20 31 20 7c 7c 20 6d 5f 41 64 64 4e 65 77 43 6f 6e 74 72 6f 6c 73 29 0d 0a Count.>.1.||.m_AddNewControls)..
38c0 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f ............{................../
38e0 2f 20 49 66 20 74 68 65 72 65 27 73 20 6d 75 6c 74 69 70 6c 65 20 63 6f 6e 74 72 6f 6c 73 2c 20 /.If.there's.multiple.controls,.
3900 77 72 69 74 65 20 69 6e 64 65 78 20 6f 66 20 63 6f 6e 74 72 6f 6c 20 74 6f 20 77 68 69 63 68 20 write.index.of.control.to.which.
3920 74 68 65 20 73 74 61 74 65 20 63 68 61 6e 67 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 the.state.change................
3940 20 20 2f 2f 20 70 65 72 74 61 69 6e 73 20 61 73 20 61 6e 20 69 6e 74 20 62 65 66 6f 72 65 20 74 ..//.pertains.as.an.int.before.t
3960 68 65 20 73 74 61 74 65 20 6d 65 6d 6f 72 79 20 63 6f 6e 74 65 6e 74 73 20 66 6f 6c 6c 6f 77 69 he.state.memory.contents.followi
3980 6e 67 20 69 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 63 6f 72 64 50 74 ng.it...................recordPt
39a0 72 2d 3e 63 6f 6e 74 72 6f 6c 49 6e 64 65 78 20 3d 20 63 6f 6e 74 72 6f 6c 49 6e 64 65 78 3b 0d r->controlIndex.=.controlIndex;.
39c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 74 65 42 75 66 66 65 72 50 74 72 20 .................stateBufferPtr.
39e0 3d 20 72 65 63 6f 72 64 50 74 72 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 43 6f 6e 74 72 6f 6c =.recordPtr->statePtrWithControl
3a00 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 Index;..............}...........
3a20 20 20 20 20 20 76 61 72 20 73 74 61 74 65 53 69 7a 65 20 3d 20 63 6f 6e 74 72 6f 6c 2e 73 74 61 .....var.stateSize.=.control.sta
3a40 74 65 42 6c 6f 63 6b 2e 61 6c 69 67 6e 65 64 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 teBlock.alignedSizeInBytes;.....
3a60 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 74 65 4f 66 66 73 65 74 20 3d 20 63 6f 6e 74 72 .........var.stateOffset.=.contr
3a80 6f 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 3b 0d 0a 0d 0a 20 20 20 ol.stateBlock.byteOffset;.......
3aa0 20 20 20 20 20 20 20 20 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 4d 65 6d 43 70 79 28 73 74 .........UnsafeUtility.MemCpy(st
3ac0 61 74 65 42 75 66 66 65 72 50 74 72 2c 20 28 62 79 74 65 2a 29 73 74 61 74 65 50 74 72 20 2b 20 ateBufferPtr,.(byte*)statePtr.+.
3ae0 73 74 61 74 65 4f 66 66 73 65 74 2c 20 73 74 61 74 65 53 69 7a 65 29 3b 0d 0a 0d 0a 20 20 20 20 stateOffset,.stateSize);........
3b00 20 20 20 20 20 20 20 20 2f 2f 20 54 72 69 67 67 65 72 20 63 61 6c 6c 62 61 63 6b 2e 0d 0a 20 20 ........//.Trigger.callback.....
3b20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 63 6f 72 64 20 3d 20 6e 65 77 20 52 65 63 6f 72 ..........var.record.=.new.Recor
3b40 64 28 74 68 69 73 2c 20 69 6e 64 65 78 2c 20 72 65 63 6f 72 64 50 74 72 29 3b 0d 0a 20 20 20 20 d(this,.index,.recordPtr);......
3b60 20 20 20 20 20 20 20 20 6f 6e 52 65 63 6f 72 64 41 64 64 65 64 3f 2e 49 6e 76 6f 6b 65 28 72 65 ........onRecordAdded?.Invoke(re
3b80 63 6f 72 64 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 72 65 63 cord);................return.rec
3ba0 6f 72 64 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 ord;..........}............publi
3bc0 63 20 49 45 6e 75 6d 65 72 61 74 6f 72 3c 52 65 63 6f 72 64 3e 20 47 65 74 45 6e 75 6d 65 72 61 c.IEnumerator<Record>.GetEnumera
3be0 74 6f 72 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 tor()..........{..............re
3c00 74 75 72 6e 20 6e 65 77 20 45 6e 75 6d 65 72 61 74 6f 72 28 74 68 69 73 29 3b 0d 0a 20 20 20 20 turn.new.Enumerator(this);......
3c20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 49 45 6e 75 6d 65 72 61 74 6f 72 20 49 45 6e ....}............IEnumerator.IEn
3c40 75 6d 65 72 61 62 6c 65 2e 47 65 74 45 6e 75 6d 65 72 61 74 6f 72 28 29 0d 0a 20 20 20 20 20 20 umerable.GetEnumerator()........
3c60 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 47 65 74 45 6e 75 6d 65 ..{..............return.GetEnume
3c80 72 61 74 6f 72 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 rator();..........}............p
3ca0 75 62 6c 69 63 20 76 6f 69 64 20 44 69 73 70 6f 73 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d ublic.void.Dispose()..........{.
3cc0 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 74 6f 70 52 65 63 6f 72 64 69 6e 67 28 29 3b 0d 0a 20 .............StopRecording();...
3ce0 20 20 20 20 20 20 20 20 20 20 20 44 65 73 74 72 6f 79 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ...........Destroy();...........
3d00 20 20 20 47 43 2e 53 75 70 70 72 65 73 73 46 69 6e 61 6c 69 7a 65 28 74 68 69 73 29 3b 0d 0a 20 ...GC.SuppressFinalize(this);...
3d20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 76 6f .......}............protected.vo
3d40 69 64 20 44 65 73 74 72 6f 79 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 id.Destroy()..........{.........
3d60 20 20 20 20 20 69 66 20 28 6d 5f 52 65 63 6f 72 64 42 75 66 66 65 72 2e 49 73 43 72 65 61 74 65 .....if.(m_RecordBuffer.IsCreate
3d80 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 d)..............{...............
3da0 20 20 20 6d 5f 52 65 63 6f 72 64 42 75 66 66 65 72 2e 44 69 73 70 6f 73 65 28 29 3b 0d 0a 20 20 ...m_RecordBuffer.Dispose();....
3dc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 52 65 63 6f 72 64 42 75 66 66 65 72 20 3d 20 6e ..............m_RecordBuffer.=.n
3de0 65 77 20 4e 61 74 69 76 65 41 72 72 61 79 3c 62 79 74 65 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 ew.NativeArray<byte>();.........
3e00 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 .....}..........}............pri
3e20 76 61 74 65 20 76 6f 69 64 20 41 6c 6c 6f 63 61 74 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d vate.void.Allocate()..........{.
3e40 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 6d 61 78 20 73 69 7a 65 20 6f 66 .............//.Find.max.size.of
3e60 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6d 5f 41 64 64 4e .state...............if.(!m_AddN
3e80 65 77 43 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 ewControls)..............{......
3ea0 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 20 3d ............m_StateSizeInBytes.=
3ec0 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 .0;..................foreach.(va
3ee0 72 20 63 6f 6e 74 72 6f 6c 20 69 6e 20 63 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 20 20 20 20 r.control.in.controls)..........
3f00 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 20 3d ............m_StateSizeInBytes.=
3f20 20 28 69 6e 74 29 4d 61 74 68 2e 4d 61 78 28 28 75 69 6e 74 29 6d 5f 53 74 61 74 65 53 69 7a 65 .(int)Math.Max((uint)m_StateSize
3f40 49 6e 42 79 74 65 73 2c 20 63 6f 6e 74 72 6f 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 2e 61 6c 69 67 InBytes,.control.stateBlock.alig
3f60 6e 65 64 53 69 7a 65 49 6e 42 79 74 65 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d nedSizeInBytes);..............}.
3f80 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b .............else..............{
3fa0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 6d ..................Debug.Assert(m
3fc0 5f 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 20 3e 20 30 2c 20 22 53 74 61 74 65 20 73 69 _StateSizeInBytes.>.0,."State.si
3fe0 7a 65 20 6d 75 73 74 20 62 65 20 68 61 76 65 20 69 6e 69 74 69 61 6c 69 7a 65 64 21 22 29 3b 0d ze.must.be.have.initialized!");.
4000 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f .............}................//
4020 20 41 6c 6c 6f 63 61 74 65 20 68 69 73 74 6f 72 79 44 65 70 74 68 20 74 69 6d 65 73 20 73 74 61 .Allocate.historyDepth.times.sta
4040 74 65 20 62 6c 6f 63 6b 73 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 6d 61 78 20 73 69 7a 65 2e te.blocks.of.the.given.max.size.
4060 20 46 6f 72 20 65 61 63 68 20 6f 6e 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 61 64 .For.each.one..............//.ad
4080 64 20 73 70 61 63 65 20 66 6f 72 20 74 68 65 20 52 65 63 6f 72 64 48 65 61 64 65 72 20 68 65 61 d.space.for.the.RecordHeader.hea
40a0 64 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 49 66 20 77 65 der...............//.NOTE:.If.we
40c0 20 6f 6e 6c 79 20 68 61 76 65 20 61 20 73 69 6e 67 6c 65 20 63 6f 6e 74 72 6f 6c 2c 20 77 65 20 .only.have.a.single.control,.we.
40e0 6f 6d 69 74 20 73 74 6f 72 69 6e 67 20 74 68 65 20 69 6e 74 65 67 65 72 20 63 6f 6e 74 72 6f 6c omit.storing.the.integer.control
4100 20 69 6e 64 65 78 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 74 6f 74 61 6c 53 69 .index...............var.totalSi
4120 7a 65 4f 66 42 75 66 66 65 72 20 3d 20 62 79 74 65 73 50 65 72 52 65 63 6f 72 64 20 2a 20 6d 5f zeOfBuffer.=.bytesPerRecord.*.m_
4140 48 69 73 74 6f 72 79 44 65 70 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 52 65 63 HistoryDepth;..............m_Rec
4160 6f 72 64 42 75 66 66 65 72 20 3d 20 6e 65 77 20 4e 61 74 69 76 65 41 72 72 61 79 3c 62 79 74 65 ordBuffer.=.new.NativeArray<byte
4180 3e 28 74 6f 74 61 6c 53 69 7a 65 4f 66 42 75 66 66 65 72 2c 20 41 6c 6c 6f 63 61 74 6f 72 2e 50 >(totalSizeOfBuffer,.Allocator.P
41a0 65 72 73 69 73 74 65 6e 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4e 61 74 69 ersistent,..................Nati
41c0 76 65 41 72 72 61 79 4f 70 74 69 6f 6e 73 2e 55 6e 69 6e 69 74 69 61 6c 69 7a 65 64 4d 65 6d 6f veArrayOptions.UninitializedMemo
41e0 72 79 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 ry);..........}............prote
4200 63 74 65 64 20 69 6e 74 20 52 65 63 6f 72 64 49 6e 64 65 78 54 6f 55 73 65 72 49 6e 64 65 78 28 cted.int.RecordIndexToUserIndex(
4220 69 6e 74 20 69 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 int.index)..........{...........
4240 20 20 20 69 66 20 28 69 6e 64 65 78 20 3c 20 6d 5f 48 65 61 64 49 6e 64 65 78 29 0d 0a 20 20 20 ...if.(index.<.m_HeadIndex).....
4260 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 5f 48 69 73 74 6f 72 79 44 65 70 .............return.m_HistoryDep
4280 74 68 20 2d 20 6d 5f 48 65 61 64 49 6e 64 65 78 20 2b 20 69 6e 64 65 78 3b 20 2f 2f 20 31 30 20 th.-.m_HeadIndex.+.index;.//.10.
42a0 2d 20 33 20 2b 20 31 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 6e 64 65 -.3.+.1..............return.inde
42c0 78 20 2d 20 6d 5f 48 65 61 64 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 x.-.m_HeadIndex;..........}.....
42e0 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 69 6e 74 20 55 73 65 72 49 6e 64 65 78 54 6f .......protected.int.UserIndexTo
4300 52 65 63 6f 72 64 49 6e 64 65 78 28 69 6e 74 20 69 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 RecordIndex(int.index)..........
4320 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 28 6d 5f 48 65 61 64 49 6e 64 {..............return.(m_HeadInd
4340 65 78 20 2b 20 69 6e 64 65 78 29 20 25 20 6d 5f 48 69 73 74 6f 72 79 44 65 70 74 68 3b 0d 0a 20 ex.+.index).%.m_HistoryDepth;...
4360 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 75 6e .......}............protected.un
4380 73 61 66 65 20 52 65 63 6f 72 64 48 65 61 64 65 72 2a 20 47 65 74 52 65 63 6f 72 64 28 69 6e 74 safe.RecordHeader*.GetRecord(int
43a0 20 69 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .index)..........{..............
43c0 69 66 20 28 21 6d 5f 52 65 63 6f 72 64 42 75 66 66 65 72 2e 49 73 43 72 65 61 74 65 64 29 0d 0a if.(!m_RecordBuffer.IsCreated)..
43e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 ................throw.new.Invali
4400 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 22 48 69 73 74 6f 72 79 20 62 75 66 dOperationException("History.buf
4420 66 65 72 20 68 61 73 20 62 65 65 6e 20 64 69 73 70 6f 73 65 64 22 29 3b 0d 0a 20 20 20 20 20 20 fer.has.been.disposed");........
4440 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 20 3c 20 30 20 7c 7c 20 69 6e 64 65 78 20 3e 3d 20 ......if.(index.<.0.||.index.>=.
4460 6d 5f 48 69 73 74 6f 72 79 44 65 70 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 m_HistoryDepth).................
4480 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4f 75 74 4f 66 52 61 6e 67 65 45 78 63 .throw.new.ArgumentOutOfRangeExc
44a0 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 69 6e 64 65 78 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 eption(nameof(index));..........
44c0 20 20 20 20 20 20 72 65 74 75 72 6e 20 28 52 65 63 6f 72 64 48 65 61 64 65 72 2a 29 28 28 62 79 ......return.(RecordHeader*)((by
44e0 74 65 2a 29 6d 5f 52 65 63 6f 72 64 42 75 66 66 65 72 2e 47 65 74 55 6e 73 61 66 65 50 74 72 28 te*)m_RecordBuffer.GetUnsafePtr(
4500 29 20 2b 20 69 6e 64 65 78 20 2a 20 62 79 74 65 73 50 65 72 52 65 63 6f 72 64 29 3b 0d 0a 20 20 ).+.index.*.bytesPerRecord);....
4520 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 75 6e 73 ......}............protected.uns
4540 61 66 65 20 52 65 63 6f 72 64 48 65 61 64 65 72 2a 20 41 6c 6c 6f 63 61 74 65 52 65 63 6f 72 64 afe.RecordHeader*.AllocateRecord
4560 28 6f 75 74 20 69 6e 74 20 69 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 (out.int.index)..........{......
4580 20 20 20 20 20 20 20 20 69 66 20 28 21 6d 5f 52 65 63 6f 72 64 42 75 66 66 65 72 2e 49 73 43 72 ........if.(!m_RecordBuffer.IsCr
45a0 65 61 74 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 6c 6c 6f 63 61 74 65 eated)..................Allocate
45c0 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 64 65 78 20 3d 20 28 6d 5f 48 65 ();................index.=.(m_He
45e0 61 64 49 6e 64 65 78 20 2b 20 6d 5f 52 65 63 6f 72 64 43 6f 75 6e 74 29 20 25 20 6d 5f 48 69 73 adIndex.+.m_RecordCount).%.m_His
4600 74 6f 72 79 44 65 70 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 toryDepth;................//.If.
4620 77 65 27 72 65 20 66 75 6c 6c 2c 20 61 64 76 61 6e 63 65 20 68 65 61 64 20 74 6f 20 6d 61 6b 65 we're.full,.advance.head.to.make
4640 20 72 6f 6f 6d 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 52 65 63 6f 72 64 .room...............if.(m_Record
4660 43 6f 75 6e 74 20 3d 3d 20 6d 5f 48 69 73 74 6f 72 79 44 65 70 74 68 29 0d 0a 20 20 20 20 20 20 Count.==.m_HistoryDepth)........
4680 20 20 20 20 20 20 20 20 20 20 6d 5f 48 65 61 64 49 6e 64 65 78 20 3d 20 28 6d 5f 48 65 61 64 49 ..........m_HeadIndex.=.(m_HeadI
46a0 6e 64 65 78 20 2b 20 31 29 20 25 20 6d 5f 48 69 73 74 6f 72 79 44 65 70 74 68 3b 0d 0a 20 20 20 ndex.+.1).%.m_HistoryDepth;.....
46c0 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 .........else..............{....
46e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 68 61 76 65 20 61 20 66 69 78 65 64 ..............//.We.have.a.fixed
4700 20 6d 61 78 20 73 69 7a 65 20 67 69 76 65 6e 20 62 79 20 74 68 65 20 68 69 73 74 6f 72 79 20 64 .max.size.given.by.the.history.d
4720 65 70 74 68 20 61 6e 64 20 77 69 6c 6c 20 73 74 61 72 74 20 6f 76 65 72 77 72 69 74 69 6e 67 0d epth.and.will.start.overwriting.
4740 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6f 6c 64 65 72 20 65 6e 74 72 69 65 .................//.older.entrie
4760 73 20 6f 6e 63 65 20 77 65 20 72 65 61 63 68 65 64 20 6d 61 78 20 73 69 7a 65 2e 0d 0a 20 20 20 s.once.we.reached.max.size......
4780 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 2b 6d 5f 52 65 63 6f 72 64 43 6f 75 6e 74 3b 0d 0a 20 .............++m_RecordCount;...
47a0 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 ...........}................retu
47c0 72 6e 20 28 52 65 63 6f 72 64 48 65 61 64 65 72 2a 29 28 28 62 79 74 65 2a 29 6d 5f 52 65 63 6f rn.(RecordHeader*)((byte*)m_Reco
47e0 72 64 42 75 66 66 65 72 2e 47 65 74 55 6e 73 61 66 65 50 74 72 28 29 20 2b 20 62 79 74 65 73 50 rdBuffer.GetUnsafePtr().+.bytesP
4800 65 72 52 65 63 6f 72 64 20 2a 20 69 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d erRecord.*.index);..........}...
4820 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 75 6e 73 61 66 65 20 54 56 61 6c 75 65 .........protected.unsafe.TValue
4840 20 52 65 61 64 56 61 6c 75 65 3c 54 56 61 6c 75 65 3e 28 52 65 63 6f 72 64 48 65 61 64 65 72 2a .ReadValue<TValue>(RecordHeader*
4860 20 64 61 74 61 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 54 56 61 6c 75 65 .data)..............where.TValue
4880 20 3a 20 73 74 72 75 63 74 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 .:.struct..........{............
48a0 20 20 2f 2f 20 47 65 74 20 63 6f 6e 74 72 6f 6c 2e 20 49 66 20 77 65 20 6f 6e 6c 79 20 68 61 76 ..//.Get.control..If.we.only.hav
48c0 65 20 61 20 73 69 6e 67 6c 65 20 6f 6e 65 2c 20 74 68 65 20 69 6e 64 65 78 20 69 73 6e 27 74 20 e.a.single.one,.the.index.isn't.
48e0 73 74 6f 72 65 64 20 6f 6e 20 74 68 65 20 64 61 74 61 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 stored.on.the.data..............
4900 20 76 61 72 20 68 61 76 65 53 69 6e 67 6c 65 43 6f 6e 74 72 6f 6c 20 3d 20 6d 5f 43 6f 6e 74 72 .var.haveSingleControl.=.m_Contr
4920 6f 6c 43 6f 75 6e 74 20 3d 3d 20 31 20 26 26 20 21 6d 5f 41 64 64 4e 65 77 43 6f 6e 74 72 6f 6c olCount.==.1.&&.!m_AddNewControl
4940 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 20 3d 20 68 61 s;..............var.control.=.ha
4960 76 65 53 69 6e 67 6c 65 43 6f 6e 74 72 6f 6c 20 3f 20 63 6f 6e 74 72 6f 6c 73 5b 30 5d 20 3a 20 veSingleControl.?.controls[0].:.
4980 63 6f 6e 74 72 6f 6c 73 5b 64 61 74 61 2d 3e 63 6f 6e 74 72 6f 6c 49 6e 64 65 78 5d 3b 0d 0a 20 controls[data->controlIndex];...
49a0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 28 63 6f 6e 74 72 6f 6c 20 69 73 20 49 6e 70 75 ...........if.(!(control.is.Inpu
49c0 74 43 6f 6e 74 72 6f 6c 3c 54 56 61 6c 75 65 3e 20 63 6f 6e 74 72 6f 6c 4f 66 54 79 70 65 29 29 tControl<TValue>.controlOfType))
49e0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 ..................throw.new.Inva
4a00 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 lidOperationException(..........
4a20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 43 61 6e 6e 6f 74 20 72 65 61 64 20 76 61 6c 75 65 20 ............$"Cannot.read.value.
4a40 6f 66 20 74 79 70 65 20 27 7b 54 79 70 65 48 65 6c 70 65 72 73 2e 47 65 74 4e 69 63 65 54 79 70 of.type.'{TypeHelpers.GetNiceTyp
4a60 65 4e 61 6d 65 28 74 79 70 65 6f 66 28 54 56 61 6c 75 65 29 29 7d 27 20 66 72 6f 6d 20 63 6f 6e eName(typeof(TValue))}'.from.con
4a80 74 72 6f 6c 20 27 7b 63 6f 6e 74 72 6f 6c 7d 27 20 77 69 74 68 20 76 61 6c 75 65 20 74 79 70 65 trol.'{control}'.with.value.type
4aa0 20 27 7b 54 79 70 65 48 65 6c 70 65 72 73 2e 47 65 74 4e 69 63 65 54 79 70 65 4e 61 6d 65 28 63 .'{TypeHelpers.GetNiceTypeName(c
4ac0 6f 6e 74 72 6f 6c 2e 76 61 6c 75 65 54 79 70 65 29 7d 27 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 ontrol.valueType)}'");..........
4ae0 20 20 20 20 20 20 2f 2f 20 47 72 61 62 20 73 74 61 74 65 20 6d 65 6d 6f 72 79 2e 0d 0a 20 20 20 ......//.Grab.state.memory......
4b00 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 74 65 50 74 72 20 3d 20 68 61 76 65 53 69 6e 67 .........var.statePtr.=.haveSing
4b20 6c 65 43 6f 6e 74 72 6f 6c 20 3f 20 64 61 74 61 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 6f 75 leControl.?.data->statePtrWithou
4b40 74 43 6f 6e 74 72 6f 6c 49 6e 64 65 78 20 3a 20 64 61 74 61 2d 3e 73 74 61 74 65 50 74 72 57 69 tControlIndex.:.data->statePtrWi
4b60 74 68 43 6f 6e 74 72 6f 6c 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 thControlIndex;..............sta
4b80 74 65 50 74 72 20 2d 3d 20 63 6f 6e 74 72 6f 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 tePtr.-=.control.stateBlock.byte
4ba0 4f 66 66 73 65 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6f 6e 74 Offset;..............return.cont
4bc0 72 6f 6c 4f 66 54 79 70 65 2e 52 65 61 64 56 61 6c 75 65 46 72 6f 6d 53 74 61 74 65 28 73 74 61 rolOfType.ReadValueFromState(sta
4be0 74 65 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 tePtr);..........}............pr
4c00 6f 74 65 63 74 65 64 20 75 6e 73 61 66 65 20 6f 62 6a 65 63 74 20 52 65 61 64 56 61 6c 75 65 41 otected.unsafe.object.ReadValueA
4c20 73 4f 62 6a 65 63 74 28 52 65 63 6f 72 64 48 65 61 64 65 72 2a 20 64 61 74 61 29 0d 0a 20 20 20 sObject(RecordHeader*.data).....
4c40 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 63 6f 6e 74 72 .....{..............//.Get.contr
4c60 6f 6c 2e 20 49 66 20 77 65 20 6f 6e 6c 79 20 68 61 76 65 20 61 20 73 69 6e 67 6c 65 20 6f 6e 65 ol..If.we.only.have.a.single.one
4c80 2c 20 74 68 65 20 69 6e 64 65 78 20 69 73 6e 27 74 20 73 74 6f 72 65 64 20 6f 6e 20 74 68 65 20 ,.the.index.isn't.stored.on.the.
4ca0 64 61 74 61 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 68 61 76 65 53 69 6e 67 6c data...............var.haveSingl
4cc0 65 43 6f 6e 74 72 6f 6c 20 3d 20 6d 5f 43 6f 6e 74 72 6f 6c 43 6f 75 6e 74 20 3d 3d 20 31 20 26 eControl.=.m_ControlCount.==.1.&
4ce0 26 20 21 6d 5f 41 64 64 4e 65 77 43 6f 6e 74 72 6f 6c 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 &.!m_AddNewControls;............
4d00 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 20 3d 20 68 61 76 65 53 69 6e 67 6c 65 43 6f 6e 74 72 6f ..var.control.=.haveSingleContro
4d20 6c 20 3f 20 63 6f 6e 74 72 6f 6c 73 5b 30 5d 20 3a 20 63 6f 6e 74 72 6f 6c 73 5b 64 61 74 61 2d l.?.controls[0].:.controls[data-
4d40 3e 63 6f 6e 74 72 6f 6c 49 6e 64 65 78 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f >controlIndex];................/
4d60 2f 20 47 72 61 62 20 73 74 61 74 65 20 6d 65 6d 6f 72 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 /.Grab.state.memory.............
4d80 20 20 76 61 72 20 73 74 61 74 65 50 74 72 20 3d 20 68 61 76 65 53 69 6e 67 6c 65 43 6f 6e 74 72 ..var.statePtr.=.haveSingleContr
4da0 6f 6c 20 3f 20 64 61 74 61 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 6f 75 74 43 6f 6e 74 72 6f ol.?.data->statePtrWithoutContro
4dc0 6c 49 6e 64 65 78 20 3a 20 64 61 74 61 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 43 6f 6e 74 72 lIndex.:.data->statePtrWithContr
4de0 6f 6c 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 74 65 50 74 72 20 2d olIndex;..............statePtr.-
4e00 3d 20 63 6f 6e 74 72 6f 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 3b =.control.stateBlock.byteOffset;
4e20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6f 6e 74 72 6f 6c 2e 52 65 61 ..............return.control.Rea
4e40 64 56 61 6c 75 65 46 72 6f 6d 53 74 61 74 65 41 73 4f 62 6a 65 63 74 28 73 74 61 74 65 50 74 72 dValueFromStateAsObject(statePtr
4e60 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 75 6e 73 61 66 65 20 );..........}............unsafe.
4e80 76 6f 69 64 20 49 49 6e 70 75 74 53 74 61 74 65 43 68 61 6e 67 65 4d 6f 6e 69 74 6f 72 2e 4e 6f void.IInputStateChangeMonitor.No
4ea0 74 69 66 79 43 6f 6e 74 72 6f 6c 53 74 61 74 65 43 68 61 6e 67 65 64 28 49 6e 70 75 74 43 6f 6e tifyControlStateChanged(InputCon
4ec0 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 64 6f 75 62 6c 65 20 74 69 6d 65 2c 0d 0a 20 20 20 20 trol.control,.double.time,......
4ee0 20 20 20 20 20 20 20 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 20 65 76 65 6e 74 50 74 72 2c 20 ........InputEventPtr.eventPtr,.
4f00 6c 6f 6e 67 20 6d 6f 6e 69 74 6f 72 49 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 long.monitorIndex)..........{...
4f20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 67 6e 6f 72 65 20 73 74 61 74 65 20 63 68 61 6e 67 ...........//.Ignore.state.chang
4f40 65 20 69 66 20 69 74 27 73 20 69 6e 20 61 6e 20 69 6e 70 75 74 20 75 70 64 61 74 65 20 77 65 27 e.if.it's.in.an.input.update.we'
4f60 72 65 20 6e 6f 74 20 69 6e 74 65 72 65 73 74 65 64 20 69 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 re.not.interested.in............
4f80 20 20 20 76 61 72 20 63 75 72 72 65 6e 74 55 70 64 61 74 65 54 79 70 65 20 3d 20 49 6e 70 75 74 ...var.currentUpdateType.=.Input
4fa0 53 74 61 74 65 2e 63 75 72 72 65 6e 74 55 70 64 61 74 65 54 79 70 65 3b 0d 0a 20 20 20 20 20 20 State.currentUpdateType;........
4fc0 20 20 20 20 20 20 76 61 72 20 75 70 64 61 74 65 54 79 70 65 4d 61 73 6b 20 3d 20 75 70 64 61 74 ......var.updateTypeMask.=.updat
4fe0 65 4d 61 73 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 28 63 75 72 72 65 6e 74 eMask;..............if.((current
5000 55 70 64 61 74 65 54 79 70 65 20 26 20 75 70 64 61 74 65 54 79 70 65 4d 61 73 6b 29 20 3d 3d 20 UpdateType.&.updateTypeMask).==.
5020 30 20 26 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 45 58 43 45 50 54 49 0.&&..................//.EXCEPTI
5040 4f 4e 3a 20 57 68 65 6e 20 77 65 27 72 65 20 72 65 63 6f 72 64 69 6e 67 20 66 69 78 65 64 20 61 ON:.When.we're.recording.fixed.a
5060 6e 64 2f 6f 72 20 64 79 6e 61 6d 69 63 20 75 70 64 61 74 65 73 2c 20 64 6f 20 4e 4f 54 20 69 67 nd/or.dynamic.updates,.do.NOT.ig
5080 6e 6f 72 65 20 74 68 65 20 73 74 61 74 65 20 63 68 61 6e 67 65 0d 0a 20 20 20 20 20 20 20 20 20 nore.the.state.change...........
50a0 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 69 74 20 69 73 20 66 72 .......//............if.it.is.fr
50c0 6f 6d 20 61 6e 20 65 76 65 6e 74 2e 20 54 68 65 20 72 65 61 73 6f 6e 20 69 73 20 74 68 61 74 20 om.an.event..The.reason.is.that.
50e0 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 63 6f 6e 63 75 72 72 65 6e 74 6c 79 20 72 65 the.input.system.concurrently.re
5100 63 6f 72 64 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 cords..................//.......
5120 20 20 20 20 20 73 74 61 74 65 20 63 68 61 6e 67 65 73 20 66 72 6f 6d 20 65 76 65 6e 74 73 20 69 .....state.changes.from.events.i
5140 6e 74 6f 20 62 6f 74 68 20 66 69 78 65 64 20 61 6e 64 20 64 79 6e 61 6d 69 63 20 75 70 64 61 74 nto.both.fixed.and.dynamic.updat
5160 65 20 62 75 66 66 65 72 73 20 69 66 20 62 6f 74 68 20 75 70 64 61 74 65 73 0d 0a 20 20 20 20 20 e.buffers.if.both.updates.......
5180 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 61 72 65 20 65 6e 61 ...........//............are.ena
51a0 62 6c 65 64 20 63 6f 6e 63 75 72 72 65 6e 74 6c 79 2e 20 54 68 69 73 20 6d 65 61 6e 73 20 74 68 bled.concurrently..This.means.th
51c0 61 74 20 77 65 20 77 69 6c 6c 20 73 65 65 20 69 6e 70 75 74 20 64 61 74 61 20 67 6f 69 6e 67 20 at.we.will.see.input.data.going.
51e0 69 6e 74 6f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 into..................//........
5200 20 20 20 20 2a 64 79 6e 61 6d 69 63 2a 20 75 70 64 61 74 65 20 73 74 61 74 65 20 62 75 66 66 65 ....*dynamic*.update.state.buffe
5220 72 73 20 64 75 72 69 6e 67 20 2a 66 69 78 65 64 2a 20 75 70 64 61 74 65 20 61 6e 64 20 76 69 63 rs.during.*fixed*.update.and.vic
5240 65 20 76 65 72 73 61 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 21 28 28 63 75 72 e.versa...................!((cur
5260 72 65 6e 74 55 70 64 61 74 65 54 79 70 65 20 26 20 28 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 rentUpdateType.&.(InputUpdateTyp
5280 65 2e 44 79 6e 61 6d 69 63 20 7c 20 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 65 2e 46 69 78 65 e.Dynamic.|.InputUpdateType.Fixe
52a0 64 29 29 20 21 3d 20 30 20 26 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 d)).!=.0.&&....................(
52c0 75 70 64 61 74 65 54 79 70 65 4d 61 73 6b 20 26 20 28 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 updateTypeMask.&.(InputUpdateTyp
52e0 65 2e 44 79 6e 61 6d 69 63 20 7c 20 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 65 2e 46 69 78 65 e.Dynamic.|.InputUpdateType.Fixe
5300 64 29 29 20 21 3d 20 30 20 26 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 d)).!=.0.&&....................e
5320 76 65 6e 74 50 74 72 2e 76 61 6c 69 64 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a ventPtr.valid))..............{..
5340 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 ................return;.........
5360 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 67 6e 6f 72 65 20 .....}................//.Ignore.
5380 73 74 61 74 65 20 63 68 61 6e 67 65 20 69 66 20 77 65 20 68 61 76 65 20 61 20 66 69 6c 74 65 72 state.change.if.we.have.a.filter
53a0 20 61 6e 64 20 74 68 65 20 73 74 61 74 65 20 63 68 61 6e 67 65 20 64 6f 65 73 6e 27 74 20 70 61 .and.the.state.change.doesn't.pa
53c0 73 73 20 74 68 65 20 63 68 65 63 6b 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6f ss.the.check...............if.(o
53e0 6e 53 68 6f 75 6c 64 52 65 63 6f 72 64 53 74 61 74 65 43 68 61 6e 67 65 20 21 3d 20 6e 75 6c 6c nShouldRecordStateChange.!=.null
5400 20 26 26 20 21 6f 6e 53 68 6f 75 6c 64 52 65 63 6f 72 64 53 74 61 74 65 43 68 61 6e 67 65 28 63 .&&.!onShouldRecordStateChange(c
5420 6f 6e 74 72 6f 6c 2c 20 74 69 6d 65 2c 20 65 76 65 6e 74 50 74 72 29 29 0d 0a 20 20 20 20 20 20 ontrol,.time,.eventPtr))........
5440 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..........return;...............
5460 20 52 65 63 6f 72 64 53 74 61 74 65 43 68 61 6e 67 65 28 63 6f 6e 74 72 6f 6c 2c 20 63 6f 6e 74 .RecordStateChange(control,.cont
5480 72 6f 6c 2e 63 75 72 72 65 6e 74 53 74 61 74 65 50 74 72 2c 20 74 69 6d 65 29 3b 0d 0a 20 20 20 rol.currentStatePtr,.time);.....
54a0 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 55 6e 75 73 65 64 2e 0d 0a 20 20 .....}............//.Unused.....
54c0 20 20 20 20 20 20 76 6f 69 64 20 49 49 6e 70 75 74 53 74 61 74 65 43 68 61 6e 67 65 4d 6f 6e 69 ......void.IInputStateChangeMoni
54e0 74 6f 72 2e 4e 6f 74 69 66 79 54 69 6d 65 72 45 78 70 69 72 65 64 28 49 6e 70 75 74 43 6f 6e 74 tor.NotifyTimerExpired(InputCont
5500 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 64 6f 75 62 6c 65 20 74 69 6d 65 2c 20 6c 6f 6e 67 20 6d rol.control,.double.time,.long.m
5520 6f 6e 69 74 6f 72 49 6e 64 65 78 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 74 69 onitorIndex,..............int.ti
5540 6d 65 72 49 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 7d 0d merIndex)..........{..........}.
5560 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 5b ...........private.InputControl[
5580 5d 20 6d 5f 43 6f 6e 74 72 6f 6c 73 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 ].m_Controls;..........private.i
55a0 6e 74 20 6d 5f 43 6f 6e 74 72 6f 6c 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 nt.m_ControlCount;..........priv
55c0 61 74 65 20 4e 61 74 69 76 65 41 72 72 61 79 3c 62 79 74 65 3e 20 6d 5f 52 65 63 6f 72 64 42 75 ate.NativeArray<byte>.m_RecordBu
55e0 66 66 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 6d 5f 53 74 61 ffer;..........private.int.m_Sta
5600 74 65 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 teSizeInBytes;..........private.
5620 69 6e 74 20 6d 5f 52 65 63 6f 72 64 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 int.m_RecordCount;..........priv
5640 61 74 65 20 69 6e 74 20 6d 5f 48 69 73 74 6f 72 79 44 65 70 74 68 20 3d 20 6b 44 65 66 61 75 6c ate.int.m_HistoryDepth.=.kDefaul
5660 74 48 69 73 74 6f 72 79 53 69 7a 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 tHistorySize;..........private.i
5680 6e 74 20 6d 5f 45 78 74 72 61 4d 65 6d 6f 72 79 50 65 72 52 65 63 6f 72 64 3b 0d 0a 20 20 20 20 nt.m_ExtraMemoryPerRecord;......
56a0 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 69 6e 74 20 6d 5f 48 65 61 64 49 6e 64 65 78 3b 0d 0a 20 ....internal.int.m_HeadIndex;...
56c0 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 75 69 6e 74 20 6d 5f 43 75 72 72 65 6e 74 56 65 .......internal.uint.m_CurrentVe
56e0 72 73 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 49 6e 70 75 74 55 70 64 rsion;..........private.InputUpd
5700 61 74 65 54 79 70 65 3f 20 6d 5f 55 70 64 61 74 65 4d 61 73 6b 3b 0d 0a 20 20 20 20 20 20 20 20 ateType?.m_UpdateMask;..........
5720 69 6e 74 65 72 6e 61 6c 20 72 65 61 64 6f 6e 6c 79 20 62 6f 6f 6c 20 6d 5f 41 64 64 4e 65 77 43 internal.readonly.bool.m_AddNewC
5740 6f 6e 74 72 6f 6c 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 69 6e 74 ontrols;............internal.int
5760 20 62 79 74 65 73 50 65 72 52 65 63 6f 72 64 20 3d 3e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .bytesPerRecord.=>..............
5780 6d 5f 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 20 2b 0d 0a 20 20 20 20 20 20 20 20 20 20 m_StateSizeInBytes.+............
57a0 20 20 6d 5f 45 78 74 72 61 4d 65 6d 6f 72 79 50 65 72 52 65 63 6f 72 64 20 2b 0d 0a 20 20 20 20 ..m_ExtraMemoryPerRecord.+......
57c0 20 20 20 20 20 20 20 20 28 6d 5f 43 6f 6e 74 72 6f 6c 43 6f 75 6e 74 20 3d 3d 20 31 20 26 26 20 ........(m_ControlCount.==.1.&&.
57e0 21 6d 5f 41 64 64 4e 65 77 43 6f 6e 74 72 6f 6c 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 !m_AddNewControls...............
5800 20 20 20 3f 20 52 65 63 6f 72 64 48 65 61 64 65 72 2e 6b 53 69 7a 65 57 69 74 68 6f 75 74 43 6f ...?.RecordHeader.kSizeWithoutCo
5820 6e 74 72 6f 6c 49 6e 64 65 78 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3a 20 52 65 ntrolIndex..................:.Re
5840 63 6f 72 64 48 65 61 64 65 72 2e 6b 53 69 7a 65 57 69 74 68 43 6f 6e 74 72 6f 6c 49 6e 64 65 78 cordHeader.kSizeWithControlIndex
5860 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 72 75 63 74 20 45 6e 75 );............private.struct.Enu
5880 6d 65 72 61 74 6f 72 20 3a 20 49 45 6e 75 6d 65 72 61 74 6f 72 3c 52 65 63 6f 72 64 3e 0d 0a 20 merator.:.IEnumerator<Record>...
58a0 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 72 65 .......{..............private.re
58c0 61 64 6f 6e 6c 79 20 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 79 20 6d 5f 48 69 73 74 6f adonly.InputStateHistory.m_Histo
58e0 72 79 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 6d 5f 49 ry;..............private.int.m_I
5900 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 45 6e 75 6d ndex;................public.Enum
5920 65 72 61 74 6f 72 28 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 79 20 68 69 73 74 6f 72 79 erator(InputStateHistory.history
5940 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 )..............{................
5960 20 20 6d 5f 48 69 73 74 6f 72 79 20 3d 20 68 69 73 74 6f 72 79 3b 0d 0a 20 20 20 20 20 20 20 20 ..m_History.=.history;..........
5980 20 20 20 20 20 20 20 20 6d 5f 49 6e 64 65 78 20 3d 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 ........m_Index.=.-1;...........
59a0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 ...}................public.bool.
59c0 4d 6f 76 65 4e 65 78 74 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 MoveNext()..............{.......
59e0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 49 6e 64 65 78 20 2b 20 31 20 3e 3d 20 6d 5f ...........if.(m_Index.+.1.>=.m_
5a00 48 69 73 74 6f 72 79 2e 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 History.Count)..................
5a20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ....return.false;...............
5a40 20 20 20 2b 2b 6d 5f 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 ...++m_Index;..................r
5a60 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 eturn.true;..............}......
5a80 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 52 65 73 65 74 28 29 0d 0a 20 ..........public.void.Reset()...
5aa0 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f ...........{..................m_
5ac0 49 6e 64 65 78 20 3d 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 Index.=.-1;..............}......
5ae0 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 63 6f 72 64 20 43 75 72 72 65 6e 74 20 ..........public.Record.Current.
5b00 3d 3e 20 6d 5f 48 69 73 74 6f 72 79 5b 6d 5f 49 6e 64 65 78 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 =>.m_History[m_Index];..........
5b20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 49 45 6e 75 6d 65 72 61 74 6f 72 2e 43 75 72 72 65 6e 74 ......object.IEnumerator.Current
5b40 20 3d 3e 20 43 75 72 72 65 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c .=>.Current;................publ
5b60 69 63 20 76 6f 69 64 20 44 69 73 70 6f 73 65 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b ic.void.Dispose()..............{
5b80 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 ..............}..........}......
5ba0 20 20 20 20 20 20 5b 53 74 72 75 63 74 4c 61 79 6f 75 74 28 4c 61 79 6f 75 74 4b 69 6e 64 2e 45 ......[StructLayout(LayoutKind.E
5bc0 78 70 6c 69 63 69 74 29 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 69 6e 74 xplicit)]..........protected.int
5be0 65 72 6e 61 6c 20 75 6e 73 61 66 65 20 73 74 72 75 63 74 20 52 65 63 6f 72 64 48 65 61 64 65 72 ernal.unsafe.struct.RecordHeader
5c00 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 46 69 65 6c 64 4f ..........{..............[FieldO
5c20 66 66 73 65 74 28 30 29 5d 20 70 75 62 6c 69 63 20 64 6f 75 62 6c 65 20 74 69 6d 65 3b 0d 0a 20 ffset(0)].public.double.time;...
5c40 20 20 20 20 20 20 20 20 20 20 20 5b 46 69 65 6c 64 4f 66 66 73 65 74 28 38 29 5d 20 70 75 62 6c ...........[FieldOffset(8)].publ
5c60 69 63 20 75 69 6e 74 20 76 65 72 73 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 46 ic.uint.version;..............[F
5c80 69 65 6c 64 4f 66 66 73 65 74 28 31 32 29 5d 20 70 75 62 6c 69 63 20 69 6e 74 20 63 6f 6e 74 72 ieldOffset(12)].public.int.contr
5ca0 6f 6c 49 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 46 69 65 6c 64 4f 66 olIndex;................[FieldOf
5cc0 66 73 65 74 28 31 32 29 5d 20 70 72 69 76 61 74 65 20 66 69 78 65 64 20 62 79 74 65 20 6d 5f 53 fset(12)].private.fixed.byte.m_S
5ce0 74 61 74 65 57 69 74 68 6f 75 74 43 6f 6e 74 72 6f 6c 49 6e 64 65 78 5b 31 5d 3b 0d 0a 20 20 20 tateWithoutControlIndex[1];.....
5d00 20 20 20 20 20 20 20 20 20 5b 46 69 65 6c 64 4f 66 66 73 65 74 28 31 36 29 5d 20 70 72 69 76 61 .........[FieldOffset(16)].priva
5d20 74 65 20 66 69 78 65 64 20 62 79 74 65 20 6d 5f 53 74 61 74 65 57 69 74 68 43 6f 6e 74 72 6f 6c te.fixed.byte.m_StateWithControl
5d40 49 6e 64 65 78 5b 31 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 Index[1];................public.
5d60 62 79 74 65 2a 20 73 74 61 74 65 50 74 72 57 69 74 68 43 6f 6e 74 72 6f 6c 49 6e 64 65 78 0d 0a byte*.statePtrWithControlIndex..
5d80 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 ............{..................g
5da0 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 et..................{...........
5dc0 20 20 20 20 20 20 20 20 20 20 20 66 69 78 65 64 28 62 79 74 65 2a 20 70 74 72 20 3d 20 6d 5f 53 ...........fixed(byte*.ptr.=.m_S
5de0 74 61 74 65 57 69 74 68 43 6f 6e 74 72 6f 6c 49 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 20 tateWithControlIndex)...........
5e00 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 70 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 ...........return.ptr;..........
5e20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 ........}..............}........
5e40 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 79 74 65 2a 20 73 74 61 74 65 50 74 72 57 69 74 ........public.byte*.statePtrWit
5e60 68 6f 75 74 43 6f 6e 74 72 6f 6c 49 6e 64 65 78 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d houtControlIndex..............{.
5e80 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 .................get............
5ea0 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69 78 ......{......................fix
5ec0 65 64 28 62 79 74 65 2a 20 70 74 72 20 3d 20 6d 5f 53 74 61 74 65 57 69 74 68 6f 75 74 43 6f 6e ed(byte*.ptr.=.m_StateWithoutCon
5ee0 74 72 6f 6c 49 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 trolIndex)......................
5f00 72 65 74 75 72 6e 20 70 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a return.ptr;..................}..
5f20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 ............}................pub
5f40 6c 69 63 20 63 6f 6e 73 74 20 69 6e 74 20 6b 53 69 7a 65 57 69 74 68 43 6f 6e 74 72 6f 6c 49 6e lic.const.int.kSizeWithControlIn
5f60 64 65 78 20 3d 20 31 36 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 63 6f dex.=.16;..............public.co
5f80 6e 73 74 20 69 6e 74 20 6b 53 69 7a 65 57 69 74 68 6f 75 74 43 6f 6e 74 72 6f 6c 49 6e 64 65 78 nst.int.kSizeWithoutControlIndex
5fa0 20 3d 20 31 32 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 .=.12;..........}............pub
5fc0 6c 69 63 20 75 6e 73 61 66 65 20 73 74 72 75 63 74 20 52 65 63 6f 72 64 20 3a 20 49 45 71 75 61 lic.unsafe.struct.Record.:.IEqua
5fe0 74 61 62 6c 65 3c 52 65 63 6f 72 64 3e 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 table<Record>..........{........
6000 20 20 20 20 20 20 2f 2f 20 57 65 20 73 74 6f 72 65 20 61 6e 20 69 6e 64 65 78 20 72 61 74 68 65 ......//.We.store.an.index.rathe
6020 72 20 74 68 61 6e 20 61 20 64 69 72 65 63 74 20 70 6f 69 6e 74 65 72 20 74 6f 20 6d 61 6b 65 20 r.than.a.direct.pointer.to.make.
6040 74 68 69 73 20 73 74 72 75 63 74 20 73 61 66 65 72 20 74 6f 20 75 73 65 2e 0d 0a 20 20 20 20 20 this.struct.safer.to.use........
6060 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 72 65 61 64 6f 6e 6c 79 20 49 6e 70 75 74 53 74 61 .......private.readonly.InputSta
6080 74 65 48 69 73 74 6f 72 79 20 6d 5f 4f 77 6e 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 teHistory.m_Owner;..............
60a0 70 72 69 76 61 74 65 20 72 65 61 64 6f 6e 6c 79 20 69 6e 74 20 6d 5f 49 6e 64 65 78 50 6c 75 73 private.readonly.int.m_IndexPlus
60c0 4f 6e 65 3b 20 2f 2f 20 50 6c 75 73 20 6f 6e 65 20 73 6f 20 74 68 61 74 20 64 65 66 61 75 6c 74 One;.//.Plus.one.so.that.default
60e0 28 69 6e 74 29 20 77 6f 72 6b 73 20 66 6f 72 20 75 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 (int).works.for.us..............
6100 20 70 72 69 76 61 74 65 20 75 69 6e 74 20 6d 5f 56 65 72 73 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 .private.uint.m_Version;........
6120 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 52 65 63 6f 72 64 48 65 61 64 65 72 2a 20 68 ........internal.RecordHeader*.h
6140 65 61 64 65 72 20 3d 3e 20 6d 5f 4f 77 6e 65 72 2e 47 65 74 52 65 63 6f 72 64 28 72 65 63 6f 72 eader.=>.m_Owner.GetRecord(recor
6160 64 49 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 69 dIndex);..............internal.i
6180 6e 74 20 72 65 63 6f 72 64 49 6e 64 65 78 20 3d 3e 20 6d 5f 49 6e 64 65 78 50 6c 75 73 4f 6e 65 nt.recordIndex.=>.m_IndexPlusOne
61a0 20 2d 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 75 69 6e 74 .-.1;..............internal.uint
61c0 20 76 65 72 73 69 6f 6e 20 3d 3e 20 6d 5f 56 65 72 73 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 .version.=>.m_Version;..........
61e0 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 76 61 6c 69 64 20 3d 3e 20 6d 5f 4f 77 6e ......public.bool.valid.=>.m_Own
6200 65 72 20 21 3d 20 64 65 66 61 75 6c 74 20 26 26 20 6d 5f 49 6e 64 65 78 50 6c 75 73 4f 6e 65 20 er.!=.default.&&.m_IndexPlusOne.
6220 21 3d 20 64 65 66 61 75 6c 74 20 26 26 20 68 65 61 64 65 72 2d 3e 76 65 72 73 69 6f 6e 20 3d 3d !=.default.&&.header->version.==
6240 20 6d 5f 56 65 72 73 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 .m_Version;................publi
6260 63 20 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 79 20 6f 77 6e 65 72 20 3d 3e 20 6d 5f 4f c.InputStateHistory.owner.=>.m_O
6280 77 6e 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 wner;................public.int.
62a0 69 6e 64 65 78 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 index..............{............
62c0 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 ......get..................{....
62e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d ..................CheckValid();.
6300 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 5f 4f 77 .....................return.m_Ow
6320 6e 65 72 2e 52 65 63 6f 72 64 49 6e 64 65 78 54 6f 55 73 65 72 49 6e 64 65 78 28 72 65 63 6f 72 ner.RecordIndexToUserIndex(recor
6340 64 49 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 dIndex);..................}.....
6360 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 .........}................public
6380 20 64 6f 75 62 6c 65 20 74 69 6d 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 .double.time..............{.....
63a0 20 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .............get................
63c0 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 ..{......................CheckVa
63e0 6c 69 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 lid();......................retu
6400 72 6e 20 68 65 61 64 65 72 2d 3e 74 69 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rn.header->time;................
6420 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 ..}..............}..............
6440 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 0d 0a 20 ..public.InputControl.control...
6460 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 65 ...........{..................ge
6480 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 t..................{............
64a0 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 ..........CheckValid();.........
64c0 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 73 20 3d 20 6d 5f 4f 77 .............var.controls.=.m_Ow
64e0 6e 65 72 2e 63 6f 6e 74 72 6f 6c 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ner.controls;...................
6500 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 73 2e 43 6f 75 6e 74 20 3d 3d 20 31 20 26 26 20 21 6d ...if.(controls.Count.==.1.&&.!m
6520 5f 4f 77 6e 65 72 2e 6d 5f 41 64 64 4e 65 77 43 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 20 20 _Owner.m_AddNewControls)........
6540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6f 6e 74 72 6f 6c ..................return.control
6560 73 5b 30 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 s[0];......................retur
6580 6e 20 63 6f 6e 74 72 6f 6c 73 5b 68 65 61 64 65 72 2d 3e 63 6f 6e 74 72 6f 6c 49 6e 64 65 78 5d n.controls[header->controlIndex]
65a0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 ;..................}............
65c0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 63 6f 72 64 ..}................public.Record
65e0 20 6e 65 78 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 .next..............{............
6600 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 ......get..................{....
6620 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d ..................CheckValid();.
6640 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 .....................var.userInd
6660 65 78 20 3d 20 6d 5f 4f 77 6e 65 72 2e 52 65 63 6f 72 64 49 6e 64 65 78 54 6f 55 73 65 72 49 6e ex.=.m_Owner.RecordIndexToUserIn
6680 64 65 78 28 74 68 69 73 2e 72 65 63 6f 72 64 49 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 dex(this.recordIndex);..........
66a0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 75 73 65 72 49 6e 64 65 78 20 2b 20 31 20 3e 3d ............if.(userIndex.+.1.>=
66c0 20 6d 5f 4f 77 6e 65 72 2e 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .m_Owner.Count).................
66e0 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 64 65 66 61 75 6c 74 3b 0d 0a 20 20 20 20 20 20 .........return.default;........
6700 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 63 6f 72 64 49 6e 64 65 78 20 3d 20 ..............var.recordIndex.=.
6720 6d 5f 4f 77 6e 65 72 2e 55 73 65 72 49 6e 64 65 78 54 6f 52 65 63 6f 72 64 49 6e 64 65 78 28 75 m_Owner.UserIndexToRecordIndex(u
6740 73 65 72 49 6e 64 65 78 20 2b 20 31 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 serIndex.+.1);..................
6760 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 52 65 63 6f 72 64 28 6d 5f 4f 77 6e 65 72 2c 20 72 ....return.new.Record(m_Owner,.r
6780 65 63 6f 72 64 49 6e 64 65 78 2c 20 6d 5f 4f 77 6e 65 72 2e 47 65 74 52 65 63 6f 72 64 28 72 65 ecordIndex,.m_Owner.GetRecord(re
67a0 63 6f 72 64 49 6e 64 65 78 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d cordIndex));..................}.
67c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 .............}................pu
67e0 62 6c 69 63 20 52 65 63 6f 72 64 20 70 72 65 76 69 6f 75 73 0d 0a 20 20 20 20 20 20 20 20 20 20 blic.Record.previous............
6800 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 ..{..................get........
6820 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..........{.....................
6840 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .CheckValid();..................
6860 20 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 78 20 3d 20 6d 5f 4f 77 6e 65 72 2e 52 65 63 6f ....var.userIndex.=.m_Owner.Reco
6880 72 64 49 6e 64 65 78 54 6f 55 73 65 72 49 6e 64 65 78 28 74 68 69 73 2e 72 65 63 6f 72 64 49 6e rdIndexToUserIndex(this.recordIn
68a0 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 75 dex);......................if.(u
68c0 73 65 72 49 6e 64 65 78 20 2d 20 31 20 3c 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 serIndex.-.1.<.0)...............
68e0 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 64 65 66 61 75 6c 74 3b 0d 0a 20 20 20 20 ...........return.default;......
6900 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 63 6f 72 64 49 6e 64 65 78 20 ................var.recordIndex.
6920 3d 20 6d 5f 4f 77 6e 65 72 2e 55 73 65 72 49 6e 64 65 78 54 6f 52 65 63 6f 72 64 49 6e 64 65 78 =.m_Owner.UserIndexToRecordIndex
6940 28 75 73 65 72 49 6e 64 65 78 20 2d 20 31 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 (userIndex.-.1);................
6960 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 52 65 63 6f 72 64 28 6d 5f 4f 77 6e 65 72 2c ......return.new.Record(m_Owner,
6980 20 72 65 63 6f 72 64 49 6e 64 65 78 2c 20 6d 5f 4f 77 6e 65 72 2e 47 65 74 52 65 63 6f 72 64 28 .recordIndex,.m_Owner.GetRecord(
69a0 72 65 63 6f 72 64 49 6e 64 65 78 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 recordIndex));..................
69c0 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 }..............}................
69e0 69 6e 74 65 72 6e 61 6c 20 52 65 63 6f 72 64 28 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 internal.Record(InputStateHistor
6a00 79 20 6f 77 6e 65 72 2c 20 69 6e 74 20 69 6e 64 65 78 2c 20 52 65 63 6f 72 64 48 65 61 64 65 72 y.owner,.int.index,.RecordHeader
6a20 2a 20 68 65 61 64 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 *.header)..............{........
6a40 20 20 20 20 20 20 20 20 20 20 6d 5f 4f 77 6e 65 72 20 3d 20 6f 77 6e 65 72 3b 0d 0a 20 20 20 20 ..........m_Owner.=.owner;......
6a60 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 6e 64 65 78 50 6c 75 73 4f 6e 65 20 3d 20 69 6e 64 ............m_IndexPlusOne.=.ind
6a80 65 78 20 2b 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 56 65 72 73 69 ex.+.1;..................m_Versi
6aa0 6f 6e 20 3d 20 68 65 61 64 65 72 2d 3e 76 65 72 73 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 on.=.header->version;...........
6ac0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 54 56 61 6c 75 ...}................public.TValu
6ae0 65 20 52 65 61 64 56 61 6c 75 65 3c 54 56 61 6c 75 65 3e 28 29 0d 0a 20 20 20 20 20 20 20 20 20 e.ReadValue<TValue>()...........
6b00 20 20 20 20 20 20 20 77 68 65 72 65 20 54 56 61 6c 75 65 20 3a 20 73 74 72 75 63 74 0d 0a 20 20 .......where.TValue.:.struct....
6b20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 68 65 ..........{..................Che
6b40 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 ckValid();..................retu
6b60 72 6e 20 6d 5f 4f 77 6e 65 72 2e 52 65 61 64 56 61 6c 75 65 3c 54 56 61 6c 75 65 3e 28 68 65 61 rn.m_Owner.ReadValue<TValue>(hea
6b80 64 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 der);..............}............
6ba0 20 20 20 20 70 75 62 6c 69 63 20 6f 62 6a 65 63 74 20 52 65 61 64 56 61 6c 75 65 41 73 4f 62 6a ....public.object.ReadValueAsObj
6bc0 65 63 74 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ect()..............{............
6be0 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ......CheckValid();.............
6c00 20 20 20 20 20 72 65 74 75 72 6e 20 6d 5f 4f 77 6e 65 72 2e 52 65 61 64 56 61 6c 75 65 41 73 4f .....return.m_Owner.ReadValueAsO
6c20 62 6a 65 63 74 28 68 65 61 64 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d bject(header);..............}...
6c40 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 2a 20 47 65 74 55 6e 73 .............public.void*.GetUns
6c60 61 66 65 4d 65 6d 6f 72 79 50 74 72 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 afeMemoryPtr()..............{...
6c80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 ...............CheckValid();....
6ca0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4f 77 6e 65 72 2e 63 6f 6e 74 72 6f ..............if.(m_Owner.contro
6cc0 6c 73 2e 43 6f 75 6e 74 20 3d 3d 20 31 20 26 26 20 21 6d 5f 4f 77 6e 65 72 2e 6d 5f 41 64 64 4e ls.Count.==.1.&&.!m_Owner.m_AddN
6ce0 65 77 43 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ewControls).....................
6d00 20 72 65 74 75 72 6e 20 68 65 61 64 65 72 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 6f 75 74 43 .return.header->statePtrWithoutC
6d20 6f 6e 74 72 6f 6c 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 ontrolIndex;..................re
6d40 74 75 72 6e 20 68 65 61 64 65 72 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 43 6f 6e 74 72 6f 6c turn.header->statePtrWithControl
6d60 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 Index;..............}...........
6d80 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 2a 20 47 65 74 55 6e 73 61 66 65 45 78 74 72 61 .....public.void*.GetUnsafeExtra
6da0 4d 65 6d 6f 72 79 50 74 72 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 MemoryPtr()..............{......
6dc0 20 20 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 20 20 20 ............CheckValid();.......
6de0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4f 77 6e 65 72 2e 65 78 74 72 61 4d 65 6d 6f ...........if.(m_Owner.extraMemo
6e00 72 79 50 65 72 52 65 63 6f 72 64 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ryPerRecord.==.0)...............
6e20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f .......throw.new.InvalidOperatio
6e40 6e 45 78 63 65 70 74 69 6f 6e 28 22 4e 6f 20 65 78 74 72 61 20 6d 65 6d 6f 72 79 20 68 61 73 20 nException("No.extra.memory.has.
6e60 62 65 65 6e 20 73 65 74 20 75 70 20 66 6f 72 20 68 69 73 74 6f 72 79 20 72 65 63 6f 72 64 73 3b been.set.up.for.history.records;
6e80 20 73 65 74 20 65 78 74 72 61 4d 65 6d 6f 72 79 50 65 72 52 65 63 6f 72 64 22 29 3b 0d 0a 20 20 .set.extraMemoryPerRecord");....
6ea0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 28 62 79 74 65 2a 29 68 65 61 64 ..............return.(byte*)head
6ec0 65 72 20 2b 20 6d 5f 4f 77 6e 65 72 2e 62 79 74 65 73 50 65 72 52 65 63 6f 72 64 20 2d 20 6d 5f er.+.m_Owner.bytesPerRecord.-.m_
6ee0 4f 77 6e 65 72 2e 65 78 74 72 61 4d 65 6d 6f 72 79 50 65 72 52 65 63 6f 72 64 3b 0d 0a 20 20 20 Owner.extraMemoryPerRecord;.....
6f00 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 .........}................public
6f20 20 76 6f 69 64 20 43 6f 70 79 46 72 6f 6d 28 52 65 63 6f 72 64 20 72 65 63 6f 72 64 29 0d 0a 20 .void.CopyFrom(Record.record)...
6f40 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 ...........{..................if
6f60 20 28 21 72 65 63 6f 72 64 2e 76 61 6c 69 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .(!record.valid)................
6f80 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f ......throw.new.ArgumentExceptio
6fa0 6e 28 22 47 69 76 65 6e 20 68 69 73 74 6f 72 79 20 72 65 63 6f 72 64 20 69 73 20 6e 6f 74 20 76 n("Given.history.record.is.not.v
6fc0 61 6c 69 64 22 2c 20 6e 61 6d 65 6f 66 28 72 65 63 6f 72 64 29 29 3b 0d 0a 20 20 20 20 20 20 20 alid",.nameof(record));.........
6fe0 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 .........CheckValid();..........
7000 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 ..........//.Find.control.......
7020 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 20 3d 20 72 65 63 6f 72 64 ............var.control.=.record
7040 2e 63 6f 6e 74 72 6f 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 .control;..................var.c
7060 6f 6e 74 72 6f 6c 49 6e 64 65 78 20 3d 20 6d 5f 4f 77 6e 65 72 2e 63 6f 6e 74 72 6f 6c 73 2e 49 ontrolIndex.=.m_Owner.controls.I
7080 6e 64 65 78 4f 66 52 65 66 65 72 65 6e 63 65 28 63 6f 6e 74 72 6f 6c 29 3b 0d 0a 20 20 20 20 20 ndexOfReference(control);.......
70a0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 49 6e 64 65 78 20 3d 3d 20 2d ...........if.(controlIndex.==.-
70c0 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 1)..................{...........
70e0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 68 61 76 65 6e 27 74 20 66 6f 75 6e 64 20 69 ...........//.We.haven't.found.i
7100 74 2e 20 54 68 72 6f 77 20 69 66 20 77 65 20 63 61 6e 27 74 20 61 64 64 20 69 74 2e 0d 0a 20 20 t..Throw.if.we.can't.add.it.....
7120 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6d 5f 4f 77 6e 65 72 2e 6d ..................if.(!m_Owner.m
7140 5f 41 64 64 4e 65 77 43 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 _AddNewControls)................
7160 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 ..........throw.new.InvalidOpera
7180 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 24 22 43 6f 6e 74 72 6f 6c 20 27 7b 72 65 63 6f 72 64 tionException($"Control.'{record
71a0 2e 63 6f 6e 74 72 6f 6c 7d 27 20 69 73 20 6e 6f 74 20 74 72 61 63 6b 65 64 20 62 79 20 74 61 72 .control}'.is.not.tracked.by.tar
71c0 67 65 74 20 68 69 73 74 6f 72 79 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 get.history");..................
71e0 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 49 6e 64 65 78 20 3d 0d 0a 20 20 20 20 20 20 20 20 20 20 ......controlIndex.=............
7200 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 72 72 61 79 48 65 6c 70 65 72 73 2e 41 70 70 65 6e ..............ArrayHelpers.Appen
7220 64 57 69 74 68 43 61 70 61 63 69 74 79 28 72 65 66 20 6d 5f 4f 77 6e 65 72 2e 6d 5f 43 6f 6e 74 dWithCapacity(ref.m_Owner.m_Cont
7240 72 6f 6c 73 2c 20 72 65 66 20 6d 5f 4f 77 6e 65 72 2e 6d 5f 43 6f 6e 74 72 6f 6c 43 6f 75 6e 74 rols,.ref.m_Owner.m_ControlCount
7260 2c 20 63 6f 6e 74 72 6f 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a ,.control);..................}..
7280 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 6b 65 20 73 75 72 65 20 6d ..................//.Make.sure.m
72a0 65 6d 6f 72 79 20 73 69 7a 65 73 20 6d 61 74 63 68 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 emory.sizes.match...............
72c0 20 20 20 20 76 61 72 20 6e 75 6d 42 79 74 65 73 46 6f 72 53 74 61 74 65 20 3d 20 6d 5f 4f 77 6e ....var.numBytesForState.=.m_Own
72e0 65 72 2e 6d 5f 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 er.m_StateSizeInBytes;..........
7300 20 20 20 20 20 20 20 20 69 66 20 28 6e 75 6d 42 79 74 65 73 46 6f 72 53 74 61 74 65 20 21 3d 20 ........if.(numBytesForState.!=.
7320 72 65 63 6f 72 64 2e 6d 5f 4f 77 6e 65 72 2e 6d 5f 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 record.m_Owner.m_StateSizeInByte
7340 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 s)......................throw.ne
7360 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 w.InvalidOperationException(....
7380 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 43 61 6e 6e 6f 74 20 63 ......................$"Cannot.c
73a0 6f 70 79 20 72 65 63 6f 72 64 20 66 72 6f 6d 20 6f 77 6e 65 72 20 77 69 74 68 20 73 74 61 74 65 opy.record.from.owner.with.state
73c0 20 73 69 7a 65 20 27 7b 72 65 63 6f 72 64 2e 6d 5f 4f 77 6e 65 72 2e 6d 5f 53 74 61 74 65 53 69 .size.'{record.m_Owner.m_StateSi
73e0 7a 65 49 6e 42 79 74 65 73 7d 27 20 74 6f 20 6f 77 6e 65 72 20 77 69 74 68 20 73 74 61 74 65 20 zeInBytes}'.to.owner.with.state.
7400 73 69 7a 65 20 27 7b 6e 75 6d 42 79 74 65 73 46 6f 72 53 74 61 74 65 7d 27 22 29 3b 0d 0a 0d 0a size.'{numBytesForState}'");....
7420 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 70 79 20 61 6e 64 20 75 70 64 61 ................//.Copy.and.upda
7440 74 65 20 68 65 61 64 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 te.header...................var.
7460 74 68 69 73 52 65 63 6f 72 64 50 74 72 20 3d 20 68 65 61 64 65 72 3b 0d 0a 20 20 20 20 20 20 20 thisRecordPtr.=.header;.........
7480 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 74 68 65 72 52 65 63 6f 72 64 50 74 72 20 3d 20 72 65 .........var.otherRecordPtr.=.re
74a0 63 6f 72 64 2e 68 65 61 64 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 6e cord.header;..................Un
74c0 73 61 66 65 55 74 69 6c 69 74 79 2e 4d 65 6d 43 70 79 28 74 68 69 73 52 65 63 6f 72 64 50 74 72 safeUtility.MemCpy(thisRecordPtr
74e0 2c 20 6f 74 68 65 72 52 65 63 6f 72 64 50 74 72 2c 20 52 65 63 6f 72 64 48 65 61 64 65 72 2e 6b ,.otherRecordPtr,.RecordHeader.k
7500 53 69 7a 65 57 69 74 68 6f 75 74 43 6f 6e 74 72 6f 6c 49 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 SizeWithoutControlIndex);.......
7520 20 20 20 20 20 20 20 20 20 20 20 74 68 69 73 52 65 63 6f 72 64 50 74 72 2d 3e 76 65 72 73 69 6f ...........thisRecordPtr->versio
7540 6e 20 3d 20 2b 2b 6d 5f 4f 77 6e 65 72 2e 6d 5f 43 75 72 72 65 6e 74 56 65 72 73 69 6f 6e 3b 0d n.=.++m_Owner.m_CurrentVersion;.
7560 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 56 65 72 73 69 6f 6e 20 3d 20 74 68 69 .................m_Version.=.thi
7580 73 52 65 63 6f 72 64 50 74 72 2d 3e 76 65 72 73 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 sRecordPtr->version;............
75a0 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 70 79 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 ........//.Copy.state...........
75c0 20 20 20 20 20 20 20 20 76 61 72 20 64 73 74 50 74 72 20 3d 20 74 68 69 73 52 65 63 6f 72 64 50 ........var.dstPtr.=.thisRecordP
75e0 74 72 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 6f 75 74 43 6f 6e 74 72 6f 6c 49 6e 64 65 78 3b tr->statePtrWithoutControlIndex;
7600 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4f 77 6e 65 72 2e 63 6f ..................if.(m_Owner.co
7620 6e 74 72 6f 6c 73 2e 43 6f 75 6e 74 20 3e 20 31 20 7c 7c 20 6d 5f 4f 77 6e 65 72 2e 6d 5f 41 64 ntrols.Count.>.1.||.m_Owner.m_Ad
7640 64 4e 65 77 43 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b dNewControls)..................{
7660 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 69 73 52 65 63 6f 72 64 ......................thisRecord
7680 50 74 72 2d 3e 63 6f 6e 74 72 6f 6c 49 6e 64 65 78 20 3d 20 63 6f 6e 74 72 6f 6c 49 6e 64 65 78 Ptr->controlIndex.=.controlIndex
76a0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 73 74 50 74 72 20 3d 20 ;......................dstPtr.=.
76c0 74 68 69 73 52 65 63 6f 72 64 50 74 72 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 43 6f 6e 74 72 thisRecordPtr->statePtrWithContr
76e0 6f 6c 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 olIndex;..................}.....
7700 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 72 63 50 74 72 20 3d 20 72 65 63 6f 72 64 .............var.srcPtr.=.record
7720 2e 6d 5f 4f 77 6e 65 72 2e 6d 5f 43 6f 6e 74 72 6f 6c 43 6f 75 6e 74 20 3e 20 31 20 7c 7c 20 72 .m_Owner.m_ControlCount.>.1.||.r
7740 65 63 6f 72 64 2e 6d 5f 4f 77 6e 65 72 2e 6d 5f 41 64 64 4e 65 77 43 6f 6e 74 72 6f 6c 73 0d 0a ecord.m_Owner.m_AddNewControls..
7760 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3f 20 6f 74 68 65 72 52 65 63 6f 72 ....................?.otherRecor
7780 64 50 74 72 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 43 6f 6e 74 72 6f 6c 49 6e 64 65 78 0d 0a dPtr->statePtrWithControlIndex..
77a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3a 20 6f 74 68 65 72 52 65 63 6f 72 ....................:.otherRecor
77c0 64 50 74 72 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 6f 75 74 43 6f 6e 74 72 6f 6c 49 6e 64 65 dPtr->statePtrWithoutControlInde
77e0 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 6e 73 61 66 65 55 74 69 6c 69 74 x;..................UnsafeUtilit
7800 79 2e 4d 65 6d 43 70 79 28 64 73 74 50 74 72 2c 20 73 72 63 50 74 72 2c 20 6e 75 6d 42 79 74 65 y.MemCpy(dstPtr,.srcPtr,.numByte
7820 73 46 6f 72 53 74 61 74 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f sForState);..................../
7840 2f 20 43 6f 70 79 20 65 78 74 72 61 20 6d 65 6d 6f 72 79 2c 20 62 75 74 20 6f 6e 6c 79 20 69 66 /.Copy.extra.memory,.but.only.if
7860 20 74 68 65 20 73 69 7a 65 20 69 6e 20 74 68 65 20 73 6f 75 72 63 65 20 61 6e 64 20 74 61 72 67 .the.size.in.the.source.and.targ
7880 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 68 69 73 74 6f 72 79 20 61 et..................//.history.a
78a0 72 65 20 69 64 65 6e 74 69 63 61 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 re.identical...................v
78c0 61 72 20 6e 75 6d 42 79 74 65 73 45 78 74 72 61 4d 65 6d 6f 72 79 20 3d 20 6d 5f 4f 77 6e 65 72 ar.numBytesExtraMemory.=.m_Owner
78e0 2e 6d 5f 45 78 74 72 61 4d 65 6d 6f 72 79 50 65 72 52 65 63 6f 72 64 3b 0d 0a 20 20 20 20 20 20 .m_ExtraMemoryPerRecord;........
7900 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 75 6d 42 79 74 65 73 45 78 74 72 61 4d 65 6d 6f 72 ..........if.(numBytesExtraMemor
7920 79 20 3e 20 30 20 26 26 20 6e 75 6d 42 79 74 65 73 45 78 74 72 61 4d 65 6d 6f 72 79 20 3d 3d 20 y.>.0.&&.numBytesExtraMemory.==.
7940 72 65 63 6f 72 64 2e 6d 5f 4f 77 6e 65 72 2e 6d 5f 45 78 74 72 61 4d 65 6d 6f 72 79 50 65 72 52 record.m_Owner.m_ExtraMemoryPerR
7960 65 63 6f 72 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 6e 73 61 ecord)......................Unsa
7980 66 65 55 74 69 6c 69 74 79 2e 4d 65 6d 43 70 79 28 47 65 74 55 6e 73 61 66 65 45 78 74 72 61 4d feUtility.MemCpy(GetUnsafeExtraM
79a0 65 6d 6f 72 79 50 74 72 28 29 2c 20 72 65 63 6f 72 64 2e 47 65 74 55 6e 73 61 66 65 45 78 74 72 emoryPtr(),.record.GetUnsafeExtr
79c0 61 4d 65 6d 6f 72 79 50 74 72 28 29 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 aMemoryPtr(),...................
79e0 20 20 20 20 20 20 20 6e 75 6d 42 79 74 65 73 45 78 74 72 61 4d 65 6d 6f 72 79 29 3b 0d 0a 0d 0a .......numBytesExtraMemory);....
7a00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 74 69 66 79 2e 0d 0a 20 20 20 20 ................//.Notify.......
7a20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4f 77 6e 65 72 2e 6f 6e 52 65 63 6f 72 64 41 64 64 65 ............m_Owner.onRecordAdde
7a40 64 3f 2e 49 6e 76 6f 6b 65 28 74 68 69 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d d?.Invoke(this);..............}.
7a60 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 76 6f 69 64 20 43 68 65 ...............internal.void.Che
7a80 63 6b 56 61 6c 69 64 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 ckValid()..............{........
7aa0 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4f 77 6e 65 72 20 3d 3d 20 64 65 66 61 75 6c 74 ..........if.(m_Owner.==.default
7ac0 20 7c 7c 20 6d 5f 49 6e 64 65 78 50 6c 75 73 4f 6e 65 20 3d 3d 20 64 65 66 61 75 6c 74 29 0d 0a .||.m_IndexPlusOne.==.default)..
7ae0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e ....................throw.new.In
7b00 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 22 56 61 6c 75 65 20 6e validOperationException("Value.n
7b20 6f 74 20 69 6e 69 74 69 61 6c 69 7a 65 64 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ot.initialized");...............
7b40 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 6e 65 65 64 20 74 6f 20 63 68 65 63 6b 20 77 68 65 74 68 ...////TODO:.need.to.check.wheth
7b60 65 72 20 6d 65 6d 6f 72 79 20 68 61 73 20 62 65 65 6e 20 64 69 73 70 6f 73 65 64 0d 0a 20 20 20 er.memory.has.been.disposed.....
7b80 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 68 65 61 64 65 72 2d 3e 76 65 72 73 69 6f 6e .............if.(header->version
7ba0 20 21 3d 20 6d 5f 56 65 72 73 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .!=.m_Version)..................
7bc0 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 ....throw.new.InvalidOperationEx
7be0 63 65 70 74 69 6f 6e 28 22 52 65 63 6f 72 64 20 69 73 20 6e 6f 20 6c 6f 6e 67 65 72 20 76 61 6c ception("Record.is.no.longer.val
7c00 69 64 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 id");..............}............
7c20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 45 71 75 61 6c 73 28 52 65 63 6f 72 64 20 6f 74 ....public.bool.Equals(Record.ot
7c40 68 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 her)..............{.............
7c60 20 20 20 20 20 72 65 74 75 72 6e 20 52 65 66 65 72 65 6e 63 65 45 71 75 61 6c 73 28 6d 5f 4f 77 .....return.ReferenceEquals(m_Ow
7c80 6e 65 72 2c 20 6f 74 68 65 72 2e 6d 5f 4f 77 6e 65 72 29 20 26 26 20 6d 5f 49 6e 64 65 78 50 6c ner,.other.m_Owner).&&.m_IndexPl
7ca0 75 73 4f 6e 65 20 3d 3d 20 6f 74 68 65 72 2e 6d 5f 49 6e 64 65 78 50 6c 75 73 4f 6e 65 20 26 26 usOne.==.other.m_IndexPlusOne.&&
7cc0 20 6d 5f 56 65 72 73 69 6f 6e 20 3d 3d 20 6f 74 68 65 72 2e 6d 5f 56 65 72 73 69 6f 6e 3b 0d 0a .m_Version.==.other.m_Version;..
7ce0 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 ............}................pub
7d00 6c 69 63 20 6f 76 65 72 72 69 64 65 20 62 6f 6f 6c 20 45 71 75 61 6c 73 28 6f 62 6a 65 63 74 20 lic.override.bool.Equals(object.
7d20 6f 62 6a 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 obj)..............{.............
7d40 20 20 20 20 20 72 65 74 75 72 6e 20 6f 62 6a 20 69 73 20 52 65 63 6f 72 64 20 6f 74 68 65 72 20 .....return.obj.is.Record.other.
7d60 26 26 20 45 71 75 61 6c 73 28 6f 74 68 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d &&.Equals(other);..............}
7d80 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 6f 76 65 72 72 69 64 65 20 ................public.override.
7da0 69 6e 74 20 47 65 74 48 61 73 68 43 6f 64 65 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b int.GetHashCode()..............{
7dc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 75 6e 63 68 65 63 6b 65 64 0d 0a 20 20 20 ..................unchecked.....
7de0 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .............{..................
7e00 20 20 20 20 76 61 72 20 68 61 73 68 43 6f 64 65 20 3d 20 6d 5f 4f 77 6e 65 72 20 21 3d 20 6e 75 ....var.hashCode.=.m_Owner.!=.nu
7e20 6c 6c 20 3f 20 6d 5f 4f 77 6e 65 72 2e 47 65 74 48 61 73 68 43 6f 64 65 28 29 20 3a 20 30 3b 0d ll.?.m_Owner.GetHashCode().:.0;.
7e40 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 61 73 68 43 6f 64 65 20 3d 20 .....................hashCode.=.
7e60 28 68 61 73 68 43 6f 64 65 20 2a 20 33 39 37 29 20 5e 20 6d 5f 49 6e 64 65 78 50 6c 75 73 4f 6e (hashCode.*.397).^.m_IndexPlusOn
7e80 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 61 73 68 43 6f 64 65 e;......................hashCode
7ea0 20 3d 20 28 68 61 73 68 43 6f 64 65 20 2a 20 33 39 37 29 20 5e 20 28 69 6e 74 29 6d 5f 56 65 72 .=.(hashCode.*.397).^.(int)m_Ver
7ec0 73 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 sion;......................retur
7ee0 6e 20 68 61 73 68 43 6f 64 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a n.hashCode;..................}..
7f00 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 ............}................pub
7f20 6c 69 63 20 6f 76 65 72 72 69 64 65 20 73 74 72 69 6e 67 20 54 6f 53 74 72 69 6e 67 28 29 0d 0a lic.override.string.ToString()..
7f40 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 ............{..................i
7f60 66 20 28 21 76 61 6c 69 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 f.(!valid)......................
7f80 72 65 74 75 72 6e 20 22 3c 49 6e 76 61 6c 69 64 3e 22 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 return."<Invalid>";.............
7fa0 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 22 7b 7b 20 63 6f 6e 74 72 6f 6c 3d 7b 63 6f 6e 74 .......return.$"{{.control={cont
7fc0 72 6f 6c 7d 20 76 61 6c 75 65 3d 7b 52 65 61 64 56 61 6c 75 65 41 73 4f 62 6a 65 63 74 28 29 7d rol}.value={ReadValueAsObject()}
7fe0 20 74 69 6d 65 3d 7b 74 69 6d 65 7d 20 7d 7d 22 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d .time={time}.}}";..............}
8000 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2f 2f 20 3c 73 ..........}......}........///.<s
8020 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f 2f 20 52 65 63 6f 72 64 73 20 76 61 6c 75 65 20 63 ummary>......///.Records.value.c
8040 68 61 6e 67 65 73 20 6f 66 20 61 20 67 69 76 65 6e 20 63 6f 6e 74 72 6f 6c 20 6f 76 65 72 20 74 hanges.of.a.given.control.over.t
8060 69 6d 65 2e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f ime.......///.</summary>......//
8080 2f 20 3c 74 79 70 65 70 61 72 61 6d 20 6e 61 6d 65 3d 22 54 56 61 6c 75 65 22 3e 3c 2f 74 79 70 /.<typeparam.name="TValue"></typ
80a0 65 70 61 72 61 6d 3e 0d 0a 20 20 20 20 70 75 62 6c 69 63 20 63 6c 61 73 73 20 49 6e 70 75 74 53 eparam>......public.class.InputS
80c0 74 61 74 65 48 69 73 74 6f 72 79 3c 54 56 61 6c 75 65 3e 20 3a 20 49 6e 70 75 74 53 74 61 74 65 tateHistory<TValue>.:.InputState
80e0 48 69 73 74 6f 72 79 2c 20 49 52 65 61 64 4f 6e 6c 79 4c 69 73 74 3c 49 6e 70 75 74 53 74 61 74 History,.IReadOnlyList<InputStat
8100 65 48 69 73 74 6f 72 79 3c 54 56 61 6c 75 65 3e 2e 52 65 63 6f 72 64 3e 0d 0a 20 20 20 20 20 20 eHistory<TValue>.Record>........
8120 20 20 77 68 65 72 65 20 54 56 61 6c 75 65 20 3a 20 73 74 72 75 63 74 0d 0a 20 20 20 20 7b 0d 0a ..where.TValue.:.struct......{..
8140 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 79 ........public.InputStateHistory
8160 28 69 6e 74 3f 20 6d 61 78 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 6e 75 6c 6c (int?.maxStateSizeInBytes.=.null
8180 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 55 73 69 6e 67 20 74 68 65 20 73 69 7a 65 20 6f 66 20 )..........//.Using.the.size.of.
81a0 74 68 65 20 76 61 6c 75 65 20 68 65 72 65 20 69 73 6e 27 74 20 71 75 69 74 65 20 63 6f 72 72 65 the.value.here.isn't.quite.corre
81c0 63 74 20 62 75 74 20 74 68 65 20 76 61 6c 75 65 20 69 73 20 75 73 65 64 20 61 73 20 61 6e 20 75 ct.but.the.value.is.used.as.an.u
81e0 70 70 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 62 6f 75 6e 64 20 6f 6e 20 73 74 6f 72 65 64 pper..........//.bound.on.stored
8200 20 73 74 61 74 65 20 73 69 7a 65 20 66 6f 72 20 77 68 69 63 68 20 74 68 65 20 73 69 7a 65 20 6f .state.size.for.which.the.size.o
8220 66 20 74 68 65 20 76 61 6c 75 65 20 73 68 6f 75 6c 64 20 62 65 20 61 20 72 65 61 73 6f 6e 61 62 f.the.value.should.be.a.reasonab
8240 6c 65 20 67 75 65 73 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 3a 20 62 61 73 65 28 6d 61 le.guess...............:.base(ma
8260 78 53 74 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 20 3f 3f 20 55 6e 73 61 66 65 55 74 69 6c 69 xStateSizeInBytes.??.UnsafeUtili
8280 74 79 2e 53 69 7a 65 4f 66 3c 54 56 61 6c 75 65 3e 28 29 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d ty.SizeOf<TValue>())..........{.
82a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 61 78 53 74 61 74 65 53 69 7a 65 49 6e 42 .............if.(maxStateSizeInB
82c0 79 74 65 73 20 3c 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 53 69 7a 65 4f 66 3c 54 56 61 6c ytes.<.UnsafeUtility.SizeOf<TVal
82e0 75 65 3e 28 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 ue>())..................throw.ne
8300 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 22 4d 61 78 20 73 74 61 74 65 20 73 w.ArgumentException("Max.state.s
8320 69 7a 65 20 63 61 6e 6e 6f 74 20 62 65 20 73 6d 61 6c 6c 65 72 20 74 68 61 6e 20 73 69 7a 65 6f ize.cannot.be.smaller.than.sizeo
8340 66 28 54 56 61 6c 75 65 29 22 2c 20 6e 61 6d 65 6f 66 28 6d 61 78 53 74 61 74 65 53 69 7a 65 49 f(TValue)",.nameof(maxStateSizeI
8360 6e 42 79 74 65 73 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 nBytes));..........}............
8380 70 75 62 6c 69 63 20 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 79 28 49 6e 70 75 74 43 6f public.InputStateHistory(InputCo
83a0 6e 74 72 6f 6c 3c 54 56 61 6c 75 65 3e 20 63 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 20 20 20 20 ntrol<TValue>.control)..........
83c0 20 20 20 20 3a 20 62 61 73 65 28 63 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a ....:.base(control)..........{..
83e0 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 ........}............public.Inpu
8400 74 53 74 61 74 65 48 69 73 74 6f 72 79 28 73 74 72 69 6e 67 20 70 61 74 68 29 0d 0a 20 20 20 20 tStateHistory(string.path)......
8420 20 20 20 20 20 20 20 20 3a 20 62 61 73 65 28 70 61 74 68 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d ........:.base(path)..........{.
8440 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 6b 65 20 73 75 72 65 20 74 68 61 74 20 74 .............//.Make.sure.that.t
8460 68 65 20 76 61 6c 75 65 20 74 79 70 65 20 6f 66 20 61 6c 6c 20 6d 61 74 63 68 65 64 20 63 6f 6e he.value.type.of.all.matched.con
8480 74 72 6f 6c 73 20 69 73 20 63 6f 6d 70 61 74 69 62 6c 65 20 77 69 74 68 20 54 56 61 6c 75 65 2e trols.is.compatible.with.TValue.
84a0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 63 6f 6e 74 72 ..............foreach.(var.contr
84c0 6f 6c 20 69 6e 20 63 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ol.in.controls).................
84e0 20 69 66 20 28 21 74 79 70 65 6f 66 28 54 56 61 6c 75 65 29 2e 49 73 41 73 73 69 67 6e 61 62 6c .if.(!typeof(TValue).IsAssignabl
8500 65 46 72 6f 6d 28 63 6f 6e 74 72 6f 6c 2e 76 61 6c 75 65 54 79 70 65 29 29 0d 0a 20 20 20 20 20 eFrom(control.valueType)).......
8520 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e ...............throw.new.Argumen
8540 74 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tException(.....................
8560 20 20 20 20 20 24 22 43 6f 6e 74 72 6f 6c 20 27 7b 63 6f 6e 74 72 6f 6c 7d 27 20 6d 61 74 63 68 .....$"Control.'{control}'.match
8580 65 64 20 62 79 20 27 7b 70 61 74 68 7d 27 20 68 61 73 20 76 61 6c 75 65 20 74 79 70 65 20 27 7b ed.by.'{path}'.has.value.type.'{
85a0 54 79 70 65 48 65 6c 70 65 72 73 2e 47 65 74 4e 69 63 65 54 79 70 65 4e 61 6d 65 28 63 6f 6e 74 TypeHelpers.GetNiceTypeName(cont
85c0 72 6f 6c 2e 76 61 6c 75 65 54 79 70 65 29 7d 27 20 77 68 69 63 68 20 69 73 20 69 6e 63 6f 6d 70 rol.valueType)}'.which.is.incomp
85e0 61 74 69 62 6c 65 20 77 69 74 68 20 27 7b 54 79 70 65 48 65 6c 70 65 72 73 2e 47 65 74 4e 69 63 atible.with.'{TypeHelpers.GetNic
8600 65 54 79 70 65 4e 61 6d 65 28 74 79 70 65 6f 66 28 54 56 61 6c 75 65 29 29 7d 27 22 29 3b 0d 0a eTypeName(typeof(TValue))}'");..
8620 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 7e 49 6e 70 75 74 53 74 61 74 65 ........}............~InputState
8640 48 69 73 74 6f 72 79 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 History()..........{............
8660 20 20 44 65 73 74 72 6f 79 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 ..Destroy();..........}.........
8680 20 20 20 70 75 62 6c 69 63 20 75 6e 73 61 66 65 20 52 65 63 6f 72 64 20 41 64 64 52 65 63 6f 72 ...public.unsafe.Record.AddRecor
86a0 64 28 52 65 63 6f 72 64 20 72 65 63 6f 72 64 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 d(Record.record)..........{.....
86c0 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 63 6f 72 64 50 74 72 20 3d 20 41 6c 6c 6f 63 61 74 .........var.recordPtr.=.Allocat
86e0 65 52 65 63 6f 72 64 28 6f 75 74 20 76 61 72 20 69 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 eRecord(out.var.index);.........
8700 20 20 20 20 20 76 61 72 20 6e 65 77 52 65 63 6f 72 64 20 3d 20 6e 65 77 20 52 65 63 6f 72 64 28 .....var.newRecord.=.new.Record(
8720 74 68 69 73 2c 20 69 6e 64 65 78 2c 20 72 65 63 6f 72 64 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 this,.index,.recordPtr);........
8740 20 20 20 20 20 20 6e 65 77 52 65 63 6f 72 64 2e 43 6f 70 79 46 72 6f 6d 28 72 65 63 6f 72 64 29 ......newRecord.CopyFrom(record)
8760 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 52 65 63 6f 72 64 3b ;..............return.newRecord;
8780 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 75 6e ..........}............public.un
87a0 73 61 66 65 20 52 65 63 6f 72 64 20 52 65 63 6f 72 64 53 74 61 74 65 43 68 61 6e 67 65 28 49 6e safe.Record.RecordStateChange(In
87c0 70 75 74 43 6f 6e 74 72 6f 6c 3c 54 56 61 6c 75 65 3e 20 63 6f 6e 74 72 6f 6c 2c 20 54 56 61 6c putControl<TValue>.control,.TVal
87e0 75 65 20 76 61 6c 75 65 2c 20 64 6f 75 62 6c 65 20 74 69 6d 65 20 3d 20 2d 31 29 0d 0a 20 20 20 ue.value,.double.time.=.-1).....
8800 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 75 73 69 6e 67 20 28 53 74 61 74 65 .....{..............using.(State
8820 45 76 65 6e 74 2e 46 72 6f 6d 28 63 6f 6e 74 72 6f 6c 2e 64 65 76 69 63 65 2c 20 6f 75 74 20 76 Event.From(control.device,.out.v
8840 61 72 20 65 76 65 6e 74 50 74 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 ar.eventPtr))..............{....
8860 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 74 65 50 74 72 20 3d 20 28 62 79 ..............var.statePtr.=.(by
8880 74 65 2a 29 53 74 61 74 65 45 76 65 6e 74 2e 46 72 6f 6d 28 65 76 65 6e 74 50 74 72 29 2d 3e 73 te*)StateEvent.From(eventPtr)->s
88a0 74 61 74 65 20 2d 20 63 6f 6e 74 72 6f 6c 2e 64 65 76 69 63 65 2e 73 74 61 74 65 42 6c 6f 63 6b tate.-.control.device.stateBlock
88c0 2e 62 79 74 65 4f 66 66 73 65 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f .byteOffset;..................co
88e0 6e 74 72 6f 6c 2e 57 72 69 74 65 56 61 6c 75 65 49 6e 74 6f 53 74 61 74 65 28 76 61 6c 75 65 2c ntrol.WriteValueIntoState(value,
8900 20 73 74 61 74 65 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 .statePtr);..................if.
8920 28 74 69 6d 65 20 3e 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 (time.>=.0).....................
8940 20 65 76 65 6e 74 50 74 72 2e 74 69 6d 65 20 3d 20 74 69 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 .eventPtr.time.=.time;..........
8960 20 20 20 20 20 20 20 20 76 61 72 20 72 65 63 6f 72 64 20 3d 20 52 65 63 6f 72 64 53 74 61 74 65 ........var.record.=.RecordState
8980 43 68 61 6e 67 65 28 63 6f 6e 74 72 6f 6c 2c 20 65 76 65 6e 74 50 74 72 29 3b 0d 0a 20 20 20 20 Change(control,.eventPtr);......
89a0 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 52 65 63 6f 72 64 28 74 68 ............return.new.Record(th
89c0 69 73 2c 20 72 65 63 6f 72 64 2e 72 65 63 6f 72 64 49 6e 64 65 78 2c 20 72 65 63 6f 72 64 2e 68 is,.record.recordIndex,.record.h
89e0 65 61 64 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 eader);..............}..........
8a00 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 6e 65 77 20 49 45 6e 75 6d 65 72 61 }............public.new.IEnumera
8a20 74 6f 72 3c 52 65 63 6f 72 64 3e 20 47 65 74 45 6e 75 6d 65 72 61 74 6f 72 28 29 0d 0a 20 20 20 tor<Record>.GetEnumerator().....
8a40 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 45 .....{..............return.new.E
8a60 6e 75 6d 65 72 61 74 6f 72 28 74 68 69 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 numerator(this);..........}.....
8a80 20 20 20 20 20 20 20 49 45 6e 75 6d 65 72 61 74 6f 72 20 49 45 6e 75 6d 65 72 61 62 6c 65 2e 47 .......IEnumerator.IEnumerable.G
8aa0 65 74 45 6e 75 6d 65 72 61 74 6f 72 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 etEnumerator()..........{.......
8ac0 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 47 65 74 45 6e 75 6d 65 72 61 74 6f 72 28 29 3b 0d 0a .......return.GetEnumerator();..
8ae0 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 6e 65 77 20 ........}............public.new.
8b00 75 6e 73 61 66 65 20 52 65 63 6f 72 64 20 74 68 69 73 5b 69 6e 74 20 69 6e 64 65 78 5d 0d 0a 20 unsafe.Record.this[int.index]...
8b20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 .......{..............get.......
8b40 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e .......{..................if.(in
8b60 64 65 78 20 3c 20 30 20 7c 7c 20 69 6e 64 65 78 20 3e 3d 20 43 6f 75 6e 74 29 0d 0a 20 20 20 20 dex.<.0.||.index.>=.Count)......
8b80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 ................throw.new.Argume
8ba0 6e 74 4f 75 74 4f 66 52 61 6e 67 65 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 ntOutOfRangeException(..........
8bc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 49 6e 64 65 78 20 7b 69 6e 64 65 78 7d 20 ................$"Index.{index}.
8be0 69 73 20 6f 75 74 20 6f 66 20 72 61 6e 67 65 20 66 6f 72 20 68 69 73 74 6f 72 79 20 77 69 74 68 is.out.of.range.for.history.with
8c00 20 7b 43 6f 75 6e 74 7d 20 65 6e 74 72 69 65 73 22 2c 20 6e 61 6d 65 6f 66 28 69 6e 64 65 78 29 .{Count}.entries",.nameof(index)
8c20 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 63 6f 72 64 );....................var.record
8c40 49 6e 64 65 78 20 3d 20 55 73 65 72 49 6e 64 65 78 54 6f 52 65 63 6f 72 64 49 6e 64 65 78 28 69 Index.=.UserIndexToRecordIndex(i
8c60 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e ndex);..................return.n
8c80 65 77 20 52 65 63 6f 72 64 28 74 68 69 73 2c 20 72 65 63 6f 72 64 49 6e 64 65 78 2c 20 47 65 74 ew.Record(this,.recordIndex,.Get
8ca0 52 65 63 6f 72 64 28 72 65 63 6f 72 64 49 6e 64 65 78 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 Record(recordIndex));...........
8cc0 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 ...}..............set...........
8ce0 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 64 65 78 20 ...{..................if.(index.
8d00 3c 20 30 20 7c 7c 20 69 6e 64 65 78 20 3e 3d 20 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 <.0.||.index.>=.Count)..........
8d20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4f 75 ............throw.new.ArgumentOu
8d40 74 4f 66 52 61 6e 67 65 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 tOfRangeException(..............
8d60 20 20 20 20 20 20 20 20 20 20 20 20 24 22 49 6e 64 65 78 20 7b 69 6e 64 65 78 7d 20 69 73 20 6f ............$"Index.{index}.is.o
8d80 75 74 20 6f 66 20 72 61 6e 67 65 20 66 6f 72 20 68 69 73 74 6f 72 79 20 77 69 74 68 20 7b 43 6f ut.of.range.for.history.with.{Co
8da0 75 6e 74 7d 20 65 6e 74 72 69 65 73 22 2c 20 6e 61 6d 65 6f 66 28 69 6e 64 65 78 29 29 3b 0d 0a unt}.entries",.nameof(index));..
8dc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 63 6f 72 64 49 6e 64 65 78 20 ................var.recordIndex.
8de0 3d 20 55 73 65 72 49 6e 64 65 78 54 6f 52 65 63 6f 72 64 49 6e 64 65 78 28 69 6e 64 65 78 29 3b =.UserIndexToRecordIndex(index);
8e00 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 77 20 52 65 63 6f 72 64 28 74 68 69 ..................new.Record(thi
8e20 73 2c 20 72 65 63 6f 72 64 49 6e 64 65 78 2c 20 47 65 74 52 65 63 6f 72 64 28 72 65 63 6f 72 64 s,.recordIndex,.GetRecord(record
8e40 49 6e 64 65 78 29 29 2e 43 6f 70 79 46 72 6f 6d 28 76 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 20 Index)).CopyFrom(value);........
8e60 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 ......}..........}............pr
8e80 69 76 61 74 65 20 73 74 72 75 63 74 20 45 6e 75 6d 65 72 61 74 6f 72 20 3a 20 49 45 6e 75 6d 65 ivate.struct.Enumerator.:.IEnume
8ea0 72 61 74 6f 72 3c 52 65 63 6f 72 64 3e 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 rator<Record>..........{........
8ec0 20 20 20 20 20 20 70 72 69 76 61 74 65 20 72 65 61 64 6f 6e 6c 79 20 49 6e 70 75 74 53 74 61 74 ......private.readonly.InputStat
8ee0 65 48 69 73 74 6f 72 79 3c 54 56 61 6c 75 65 3e 20 6d 5f 48 69 73 74 6f 72 79 3b 0d 0a 20 20 20 eHistory<TValue>.m_History;.....
8f00 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 6d 5f 49 6e 64 65 78 3b 0d 0a 0d .........private.int.m_Index;...
8f20 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 45 6e 75 6d 65 72 61 74 6f 72 28 49 .............public.Enumerator(I
8f40 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 79 3c 54 56 61 6c 75 65 3e 20 68 69 73 74 6f 72 79 nputStateHistory<TValue>.history
8f60 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 )..............{................
8f80 20 20 6d 5f 48 69 73 74 6f 72 79 20 3d 20 68 69 73 74 6f 72 79 3b 0d 0a 20 20 20 20 20 20 20 20 ..m_History.=.history;..........
8fa0 20 20 20 20 20 20 20 20 6d 5f 49 6e 64 65 78 20 3d 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 ........m_Index.=.-1;...........
8fc0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 ...}................public.bool.
8fe0 4d 6f 76 65 4e 65 78 74 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 MoveNext()..............{.......
9000 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 49 6e 64 65 78 20 2b 20 31 20 3e 3d 20 6d 5f ...........if.(m_Index.+.1.>=.m_
9020 48 69 73 74 6f 72 79 2e 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 History.Count)..................
9040 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ....return.false;...............
9060 20 20 20 2b 2b 6d 5f 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 ...++m_Index;..................r
9080 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 eturn.true;..............}......
90a0 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 52 65 73 65 74 28 29 0d 0a 20 ..........public.void.Reset()...
90c0 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f ...........{..................m_
90e0 49 6e 64 65 78 20 3d 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 Index.=.-1;..............}......
9100 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 63 6f 72 64 20 43 75 72 72 65 6e 74 20 ..........public.Record.Current.
9120 3d 3e 20 6d 5f 48 69 73 74 6f 72 79 5b 6d 5f 49 6e 64 65 78 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 =>.m_History[m_Index];..........
9140 20 20 20 20 20 20 6f 62 6a 65 63 74 20 49 45 6e 75 6d 65 72 61 74 6f 72 2e 43 75 72 72 65 6e 74 ......object.IEnumerator.Current
9160 20 3d 3e 20 43 75 72 72 65 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c .=>.Current;................publ
9180 69 63 20 76 6f 69 64 20 44 69 73 70 6f 73 65 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b ic.void.Dispose()..............{
91a0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 ..............}..........}......
91c0 20 20 20 20 20 20 70 75 62 6c 69 63 20 6e 65 77 20 75 6e 73 61 66 65 20 73 74 72 75 63 74 20 52 ......public.new.unsafe.struct.R
91e0 65 63 6f 72 64 20 3a 20 49 45 71 75 61 74 61 62 6c 65 3c 52 65 63 6f 72 64 3e 0d 0a 20 20 20 20 ecord.:.IEquatable<Record>......
9200 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 72 65 61 64 6f ....{..............private.reado
9220 6e 6c 79 20 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 79 3c 54 56 61 6c 75 65 3e 20 6d 5f nly.InputStateHistory<TValue>.m_
9240 4f 77 6e 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 72 65 61 64 Owner;..............private.read
9260 6f 6e 6c 79 20 69 6e 74 20 6d 5f 49 6e 64 65 78 50 6c 75 73 4f 6e 65 3b 0d 0a 20 20 20 20 20 20 only.int.m_IndexPlusOne;........
9280 20 20 20 20 20 20 70 72 69 76 61 74 65 20 75 69 6e 74 20 6d 5f 56 65 72 73 69 6f 6e 3b 0d 0a 0d ......private.uint.m_Version;...
92a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 52 65 63 6f 72 64 48 65 61 64 .............internal.RecordHead
92c0 65 72 2a 20 68 65 61 64 65 72 20 3d 3e 20 6d 5f 4f 77 6e 65 72 2e 47 65 74 52 65 63 6f 72 64 28 er*.header.=>.m_Owner.GetRecord(
92e0 72 65 63 6f 72 64 49 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 recordIndex);..............inter
9300 6e 61 6c 20 69 6e 74 20 72 65 63 6f 72 64 49 6e 64 65 78 20 3d 3e 20 6d 5f 49 6e 64 65 78 50 6c nal.int.recordIndex.=>.m_IndexPl
9320 75 73 4f 6e 65 20 2d 20 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 usOne.-.1;................public
9340 20 62 6f 6f 6c 20 76 61 6c 69 64 20 3d 3e 20 6d 5f 4f 77 6e 65 72 20 21 3d 20 64 65 66 61 75 6c .bool.valid.=>.m_Owner.!=.defaul
9360 74 20 26 26 20 6d 5f 49 6e 64 65 78 50 6c 75 73 4f 6e 65 20 21 3d 20 64 65 66 61 75 6c 74 20 26 t.&&.m_IndexPlusOne.!=.default.&
9380 26 20 68 65 61 64 65 72 2d 3e 76 65 72 73 69 6f 6e 20 3d 3d 20 6d 5f 56 65 72 73 69 6f 6e 3b 0d &.header->version.==.m_Version;.
93a0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 53 74 61 74 65 ...............public.InputState
93c0 48 69 73 74 6f 72 79 3c 54 56 61 6c 75 65 3e 20 6f 77 6e 65 72 20 3d 3e 20 6d 5f 4f 77 6e 65 72 History<TValue>.owner.=>.m_Owner
93e0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 69 6e 64 65 ;................public.int.inde
9400 78 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 x..............{................
9420 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 ..get..................{........
9440 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 20 ..............CheckValid();.....
9460 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 5f 4f 77 6e 65 72 2e .................return.m_Owner.
9480 52 65 63 6f 72 64 49 6e 64 65 78 54 6f 55 73 65 72 49 6e 64 65 78 28 72 65 63 6f 72 64 49 6e 64 RecordIndexToUserIndex(recordInd
94a0 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 ex);..................}.........
94c0 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 64 6f 75 .....}................public.dou
94e0 62 6c 65 20 74 69 6d 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 ble.time..............{.........
9500 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d .........get..................{.
9520 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 .....................CheckValid(
9540 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 68 );......................return.h
9560 65 61 64 65 72 2d 3e 74 69 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d eader->time;..................}.
9580 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 .............}................pu
95a0 62 6c 69 63 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3c 54 56 61 6c 75 65 3e 20 63 6f 6e 74 72 6f blic.InputControl<TValue>.contro
95c0 6c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 l..............{................
95e0 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 ..get..................{........
9600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 20 ..............CheckValid();.....
9620 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 73 20 3d 20 .................var.controls.=.
9640 6d 5f 4f 77 6e 65 72 2e 63 6f 6e 74 72 6f 6c 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 m_Owner.controls;...............
9660 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 73 2e 43 6f 75 6e 74 20 3d 3d 20 31 20 26 .......if.(controls.Count.==.1.&
9680 26 20 21 6d 5f 4f 77 6e 65 72 2e 6d 5f 41 64 64 4e 65 77 43 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 &.!m_Owner.m_AddNewControls)....
96a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 28 49 6e ......................return.(In
96c0 70 75 74 43 6f 6e 74 72 6f 6c 3c 54 56 61 6c 75 65 3e 29 63 6f 6e 74 72 6f 6c 73 5b 30 5d 3b 0d putControl<TValue>)controls[0];.
96e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 28 49 6e 70 .....................return.(Inp
9700 75 74 43 6f 6e 74 72 6f 6c 3c 54 56 61 6c 75 65 3e 29 63 6f 6e 74 72 6f 6c 73 5b 68 65 61 64 65 utControl<TValue>)controls[heade
9720 72 2d 3e 63 6f 6e 74 72 6f 6c 49 6e 64 65 78 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 r->controlIndex];...............
9740 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 ...}..............}.............
9760 20 20 20 70 75 62 6c 69 63 20 52 65 63 6f 72 64 20 6e 65 78 74 0d 0a 20 20 20 20 20 20 20 20 20 ...public.Record.next...........
9780 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 ...{..................get.......
97a0 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...........{....................
97c0 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..CheckValid();.................
97e0 20 20 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 78 20 3d 20 6d 5f 4f 77 6e 65 72 2e 52 65 63 .....var.userIndex.=.m_Owner.Rec
9800 6f 72 64 49 6e 64 65 78 54 6f 55 73 65 72 49 6e 64 65 78 28 74 68 69 73 2e 72 65 63 6f 72 64 49 ordIndexToUserIndex(this.recordI
9820 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 ndex);......................if.(
9840 75 73 65 72 49 6e 64 65 78 20 2b 20 31 20 3e 3d 20 6d 5f 4f 77 6e 65 72 2e 43 6f 75 6e 74 29 0d userIndex.+.1.>=.m_Owner.Count).
9860 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 .........................return.
9880 64 65 66 61 75 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 default;......................va
98a0 72 20 72 65 63 6f 72 64 49 6e 64 65 78 20 3d 20 6d 5f 4f 77 6e 65 72 2e 55 73 65 72 49 6e 64 65 r.recordIndex.=.m_Owner.UserInde
98c0 78 54 6f 52 65 63 6f 72 64 49 6e 64 65 78 28 75 73 65 72 49 6e 64 65 78 20 2b 20 31 29 3b 0d 0a xToRecordIndex(userIndex.+.1);..
98e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 52 ....................return.new.R
9900 65 63 6f 72 64 28 6d 5f 4f 77 6e 65 72 2c 20 72 65 63 6f 72 64 49 6e 64 65 78 2c 20 6d 5f 4f 77 ecord(m_Owner,.recordIndex,.m_Ow
9920 6e 65 72 2e 47 65 74 52 65 63 6f 72 64 28 72 65 63 6f 72 64 49 6e 64 65 78 29 29 3b 0d 0a 20 20 ner.GetRecord(recordIndex));....
9940 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a ..............}..............}..
9960 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 63 6f 72 64 20 70 72 65 76 ..............public.Record.prev
9980 69 6f 75 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ious..............{.............
99a0 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 .....get..................{.....
99c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a .................CheckValid();..
99e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 75 73 65 72 49 6e 64 65 ....................var.userInde
9a00 78 20 3d 20 6d 5f 4f 77 6e 65 72 2e 52 65 63 6f 72 64 49 6e 64 65 78 54 6f 55 73 65 72 49 6e 64 x.=.m_Owner.RecordIndexToUserInd
9a20 65 78 28 74 68 69 73 2e 72 65 63 6f 72 64 49 6e 64 65 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ex(this.recordIndex);...........
9a40 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 75 73 65 72 49 6e 64 65 78 20 2d 20 31 20 3c 20 30 ...........if.(userIndex.-.1.<.0
9a60 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 )..........................retur
9a80 6e 20 64 65 66 61 75 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 n.default;......................
9aa0 76 61 72 20 72 65 63 6f 72 64 49 6e 64 65 78 20 3d 20 6d 5f 4f 77 6e 65 72 2e 55 73 65 72 49 6e var.recordIndex.=.m_Owner.UserIn
9ac0 64 65 78 54 6f 52 65 63 6f 72 64 49 6e 64 65 78 28 75 73 65 72 49 6e 64 65 78 20 2d 20 31 29 3b dexToRecordIndex(userIndex.-.1);
9ae0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 ......................return.new
9b00 20 52 65 63 6f 72 64 28 6d 5f 4f 77 6e 65 72 2c 20 72 65 63 6f 72 64 49 6e 64 65 78 2c 20 6d 5f .Record(m_Owner,.recordIndex,.m_
9b20 4f 77 6e 65 72 2e 47 65 74 52 65 63 6f 72 64 28 72 65 63 6f 72 64 49 6e 64 65 78 29 29 3b 0d 0a Owner.GetRecord(recordIndex));..
9b40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d ................}..............}
9b60 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 52 65 63 6f 72 64 28 ................internal.Record(
9b80 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 6f 72 79 3c 54 56 61 6c 75 65 3e 20 6f 77 6e 65 72 2c InputStateHistory<TValue>.owner,
9ba0 20 69 6e 74 20 69 6e 64 65 78 2c 20 52 65 63 6f 72 64 48 65 61 64 65 72 2a 20 68 65 61 64 65 72 .int.index,.RecordHeader*.header
9bc0 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 )..............{................
9be0 20 20 6d 5f 4f 77 6e 65 72 20 3d 20 6f 77 6e 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ..m_Owner.=.owner;..............
9c00 20 20 20 20 6d 5f 49 6e 64 65 78 50 6c 75 73 4f 6e 65 20 3d 20 69 6e 64 65 78 20 2b 20 31 3b 0d ....m_IndexPlusOne.=.index.+.1;.
9c20 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 56 65 72 73 69 6f 6e 20 3d 20 68 65 61 .................m_Version.=.hea
9c40 64 65 72 2d 3e 76 65 72 73 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a der->version;..............}....
9c60 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 54 56 61 6c 75 65 20 52 65 61 64 56 61 ............public.TValue.ReadVa
9c80 6c 75 65 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 lue()..............{............
9ca0 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ......CheckValid();.............
9cc0 20 20 20 20 20 72 65 74 75 72 6e 20 6d 5f 4f 77 6e 65 72 2e 52 65 61 64 56 61 6c 75 65 3c 54 56 .....return.m_Owner.ReadValue<TV
9ce0 61 6c 75 65 3e 28 68 65 61 64 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d alue>(header);..............}...
9d00 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 2a 20 47 65 74 55 6e 73 .............public.void*.GetUns
9d20 61 66 65 4d 65 6d 6f 72 79 50 74 72 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 afeMemoryPtr()..............{...
9d40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 ...............CheckValid();....
9d60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4f 77 6e 65 72 2e 63 6f 6e 74 72 6f ..............if.(m_Owner.contro
9d80 6c 73 2e 43 6f 75 6e 74 20 3d 3d 20 31 20 26 26 20 21 6d 5f 4f 77 6e 65 72 2e 6d 5f 41 64 64 4e ls.Count.==.1.&&.!m_Owner.m_AddN
9da0 65 77 43 6f 6e 74 72 6f 6c 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ewControls).....................
9dc0 20 72 65 74 75 72 6e 20 68 65 61 64 65 72 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 6f 75 74 43 .return.header->statePtrWithoutC
9de0 6f 6e 74 72 6f 6c 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 ontrolIndex;..................re
9e00 74 75 72 6e 20 68 65 61 64 65 72 2d 3e 73 74 61 74 65 50 74 72 57 69 74 68 43 6f 6e 74 72 6f 6c turn.header->statePtrWithControl
9e20 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 Index;..............}...........
9e40 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 2a 20 47 65 74 55 6e 73 61 66 65 45 78 74 72 61 .....public.void*.GetUnsafeExtra
9e60 4d 65 6d 6f 72 79 50 74 72 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 MemoryPtr()..............{......
9e80 20 20 20 20 20 20 20 20 20 20 20 20 43 68 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 20 20 20 ............CheckValid();.......
9ea0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4f 77 6e 65 72 2e 65 78 74 72 61 4d 65 6d 6f ...........if.(m_Owner.extraMemo
9ec0 72 79 50 65 72 52 65 63 6f 72 64 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ryPerRecord.==.0)...............
9ee0 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f .......throw.new.InvalidOperatio
9f00 6e 45 78 63 65 70 74 69 6f 6e 28 22 4e 6f 20 65 78 74 72 61 20 6d 65 6d 6f 72 79 20 68 61 73 20 nException("No.extra.memory.has.
9f20 62 65 65 6e 20 73 65 74 20 75 70 20 66 6f 72 20 68 69 73 74 6f 72 79 20 72 65 63 6f 72 64 73 3b been.set.up.for.history.records;
9f40 20 73 65 74 20 65 78 74 72 61 4d 65 6d 6f 72 79 50 65 72 52 65 63 6f 72 64 22 29 3b 0d 0a 20 20 .set.extraMemoryPerRecord");....
9f60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 28 62 79 74 65 2a 29 68 65 61 64 ..............return.(byte*)head
9f80 65 72 20 2b 20 6d 5f 4f 77 6e 65 72 2e 62 79 74 65 73 50 65 72 52 65 63 6f 72 64 20 2d 20 6d 5f er.+.m_Owner.bytesPerRecord.-.m_
9fa0 4f 77 6e 65 72 2e 65 78 74 72 61 4d 65 6d 6f 72 79 50 65 72 52 65 63 6f 72 64 3b 0d 0a 20 20 20 Owner.extraMemoryPerRecord;.....
9fc0 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 .........}................public
9fe0 20 76 6f 69 64 20 43 6f 70 79 46 72 6f 6d 28 52 65 63 6f 72 64 20 72 65 63 6f 72 64 29 0d 0a 20 .void.CopyFrom(Record.record)...
a000 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 68 ...........{..................Ch
a020 65 63 6b 56 61 6c 69 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 eckValid();..................if.
a040 28 21 72 65 63 6f 72 64 2e 76 61 6c 69 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 (!record.valid).................
a060 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e .....throw.new.ArgumentException
a080 28 22 47 69 76 65 6e 20 68 69 73 74 6f 72 79 20 72 65 63 6f 72 64 20 69 73 20 6e 6f 74 20 76 61 ("Given.history.record.is.not.va
a0a0 6c 69 64 22 2c 20 6e 61 6d 65 6f 66 28 72 65 63 6f 72 64 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 lid",.nameof(record));..........
a0c0 20 20 20 20 20 20 20 20 76 61 72 20 74 65 6d 70 20 3d 20 6e 65 77 20 49 6e 70 75 74 53 74 61 74 ........var.temp.=.new.InputStat
a0e0 65 48 69 73 74 6f 72 79 2e 52 65 63 6f 72 64 28 6d 5f 4f 77 6e 65 72 2c 20 72 65 63 6f 72 64 49 eHistory.Record(m_Owner,.recordI
a100 6e 64 65 78 2c 20 68 65 61 64 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ndex,.header);..................
a120 74 65 6d 70 2e 43 6f 70 79 46 72 6f 6d 28 6e 65 77 20 49 6e 70 75 74 53 74 61 74 65 48 69 73 74 temp.CopyFrom(new.InputStateHist
a140 6f 72 79 2e 52 65 63 6f 72 64 28 72 65 63 6f 72 64 2e 6d 5f 4f 77 6e 65 72 2c 20 72 65 63 6f 72 ory.Record(record.m_Owner,.recor
a160 64 2e 72 65 63 6f 72 64 49 6e 64 65 78 2c 20 72 65 63 6f 72 64 2e 68 65 61 64 65 72 29 29 3b 0d d.recordIndex,.record.header));.
a180 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 56 65 72 73 69 6f 6e 20 3d 20 74 65 6d .................m_Version.=.tem
a1a0 70 2e 76 65 72 73 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 p.version;..............}.......
a1c0 20 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 43 68 65 63 6b 56 61 6c 69 64 .........private.void.CheckValid
a1e0 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ()..............{...............
a200 20 20 20 69 66 20 28 6d 5f 4f 77 6e 65 72 20 3d 3d 20 64 65 66 61 75 6c 74 20 7c 7c 20 6d 5f 49 ...if.(m_Owner.==.default.||.m_I
a220 6e 64 65 78 50 6c 75 73 4f 6e 65 20 3d 3d 20 64 65 66 61 75 6c 74 29 0d 0a 20 20 20 20 20 20 20 ndexPlusOne.==.default).........
a240 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 .............throw.new.InvalidOp
a260 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 22 56 61 6c 75 65 20 6e 6f 74 20 69 6e 69 74 erationException("Value.not.init
a280 69 61 6c 69 7a 65 64 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 ialized");..................if.(
a2a0 68 65 61 64 65 72 2d 3e 76 65 72 73 69 6f 6e 20 21 3d 20 6d 5f 56 65 72 73 69 6f 6e 29 0d 0a 20 header->version.!=.m_Version)...
a2c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 ...................throw.new.Inv
a2e0 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 22 52 65 63 6f 72 64 20 69 alidOperationException("Record.i
a300 73 20 6e 6f 20 6c 6f 6e 67 65 72 20 76 61 6c 69 64 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 s.no.longer.valid");............
a320 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 45 ..}................public.bool.E
a340 71 75 61 6c 73 28 52 65 63 6f 72 64 20 6f 74 68 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 quals(Record.other).............
a360 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 52 65 66 65 72 .{..................return.Refer
a380 65 6e 63 65 45 71 75 61 6c 73 28 6d 5f 4f 77 6e 65 72 2c 20 6f 74 68 65 72 2e 6d 5f 4f 77 6e 65 enceEquals(m_Owner,.other.m_Owne
a3a0 72 29 20 26 26 20 6d 5f 49 6e 64 65 78 50 6c 75 73 4f 6e 65 20 3d 3d 20 6f 74 68 65 72 2e 6d 5f r).&&.m_IndexPlusOne.==.other.m_
a3c0 49 6e 64 65 78 50 6c 75 73 4f 6e 65 20 26 26 20 6d 5f 56 65 72 73 69 6f 6e 20 3d 3d 20 6f 74 68 IndexPlusOne.&&.m_Version.==.oth
a3e0 65 72 2e 6d 5f 56 65 72 73 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a er.m_Version;..............}....
a400 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 6f 76 65 72 72 69 64 65 20 62 6f 6f 6c ............public.override.bool
a420 20 45 71 75 61 6c 73 28 6f 62 6a 65 63 74 20 6f 62 6a 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .Equals(object.obj).............
a440 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6f 62 6a 20 69 .{..................return.obj.i
a460 73 20 52 65 63 6f 72 64 20 6f 74 68 65 72 20 26 26 20 45 71 75 61 6c 73 28 6f 74 68 65 72 29 3b s.Record.other.&&.Equals(other);
a480 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 ..............}................p
a4a0 75 62 6c 69 63 20 6f 76 65 72 72 69 64 65 20 69 6e 74 20 47 65 74 48 61 73 68 43 6f 64 65 28 29 ublic.override.int.GetHashCode()
a4c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..............{.................
a4e0 20 75 6e 63 68 65 63 6b 65 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 .unchecked..................{...
a500 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 68 61 73 68 43 6f 64 65 20 ...................var.hashCode.
a520 3d 20 6d 5f 4f 77 6e 65 72 20 21 3d 20 6e 75 6c 6c 20 3f 20 6d 5f 4f 77 6e 65 72 2e 47 65 74 48 =.m_Owner.!=.null.?.m_Owner.GetH
a540 61 73 68 43 6f 64 65 28 29 20 3a 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ashCode().:.0;..................
a560 20 20 20 20 68 61 73 68 43 6f 64 65 20 3d 20 28 68 61 73 68 43 6f 64 65 20 2a 20 33 39 37 29 20 ....hashCode.=.(hashCode.*.397).
a580 5e 20 6d 5f 49 6e 64 65 78 50 6c 75 73 4f 6e 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ^.m_IndexPlusOne;...............
a5a0 20 20 20 20 20 20 20 68 61 73 68 43 6f 64 65 20 3d 20 28 68 61 73 68 43 6f 64 65 20 2a 20 33 39 .......hashCode.=.(hashCode.*.39
a5c0 37 29 20 5e 20 28 69 6e 74 29 6d 5f 56 65 72 73 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 7).^.(int)m_Version;............
a5e0 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 68 61 73 68 43 6f 64 65 3b 0d 0a 20 20 20 20 ..........return.hashCode;......
a600 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a ............}..............}....
a620 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 6f 76 65 72 72 69 64 65 20 73 74 72 69 ............public.override.stri
a640 6e 67 20 54 6f 53 74 72 69 6e 67 28 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 ng.ToString()..............{....
a660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 76 61 6c 69 64 29 0d 0a 20 20 20 20 20 ..............if.(!valid).......
a680 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 22 3c 49 6e 76 61 6c 69 64 3e ...............return."<Invalid>
a6a0 22 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 22 7b ";....................return.$"{
a6c0 7b 20 63 6f 6e 74 72 6f 6c 3d 7b 63 6f 6e 74 72 6f 6c 7d 20 76 61 6c 75 65 3d 7b 52 65 61 64 56 {.control={control}.value={ReadV
a6e0 61 6c 75 65 28 29 7d 20 74 69 6d 65 3d 7b 74 69 6d 65 7d 20 7d 7d 22 3b 0d 0a 20 20 20 20 20 20 alue()}.time={time}.}}";........
a700 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 7d 0d 0a 00 00 ......}..........}......}..}....
a720 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 49 6e 70 75 74 53 74 61 ........................InputSta
a740 74 65 48 69 73 74 6f 72 79 00 00 00 20 00 00 00 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 teHistory.......UnityEngine.Inpu
a760 74 53 79 73 74 65 6d 2e 4c 6f 77 4c 65 76 65 6c tSystem.LowLevel