summaryrefslogtreecommitdiff
path: root/Library/Artifacts/48/48fa05ac71e0f5ae32891dcc1b33ce71
blob: 5571c182b11de05663b33ade9014f7bba77a2eb0 (plain)
ofshex dumpascii
0000 00 00 0f 81 00 00 bc 0c 00 00 00 15 00 00 10 00 00 00 00 00 32 30 31 39 2e 33 2e 36 66 31 00 fe ....................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 ac ab 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 16 00 00 00 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 45 78 74 65 6e 73 69 6f ............InputControlExtensio
10a0 6e 73 00 00 17 ab 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 ns......using.System;..using.Sys
10c0 74 65 6d 2e 43 6f 6c 6c 65 63 74 69 6f 6e 73 2e 47 65 6e 65 72 69 63 3b 0d 0a 75 73 69 6e 67 20 tem.Collections.Generic;..using.
10e0 53 79 73 74 65 6d 2e 54 65 78 74 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 2e 43 6f 6c 6c 65 63 System.Text;..using.Unity.Collec
1100 74 69 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 tions;..using.Unity.Collections.
1120 4c 6f 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 LowLevel.Unsafe;..using.UnityEng
1140 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 43 6f 6e 74 72 6f 6c 73 3b 0d 0a 75 73 69 6e 67 ine.InputSystem.Controls;..using
1160 20 55 6e 69 74 79 45 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 .UnityEngine.InputSystem.LowLeve
1180 6c 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 l;..using.UnityEngine.InputSyste
11a0 6d 2e 55 74 69 6c 69 74 69 65 73 3b 0d 0a 0d 0a 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 73 6f 6d 65 m.Utilities;....////REVIEW:.some
11c0 20 6f 66 20 74 68 65 20 73 74 75 66 66 20 68 65 72 65 20 69 73 20 72 65 61 6c 6c 79 20 6c 6f 77 .of.the.stuff.here.is.really.low
11e0 2d 6c 65 76 65 6c 3b 20 73 68 6f 75 6c 64 20 77 65 20 6d 6f 76 65 20 69 74 20 69 6e 74 6f 20 61 -level;.should.we.move.it.into.a
1200 20 73 65 70 61 72 61 74 65 20 73 74 61 74 69 63 20 63 6c 61 73 73 20 69 6e 73 69 64 65 20 6f 66 .separate.static.class.inside.of
1220 20 2e 4c 6f 77 4c 65 76 65 6c 3f 0d 0a 0d 0a 6e 61 6d 65 73 70 61 63 65 20 55 6e 69 74 79 45 6e ..LowLevel?....namespace.UnityEn
1240 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 0d 0a 7b 0d 0a 20 20 20 20 2f 2f 2f 20 3c 73 75 gine.InputSystem..{......///.<su
1260 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f 2f 20 56 61 72 69 6f 75 73 20 65 78 74 65 6e 73 69 6f mmary>......///.Various.extensio
1280 6e 20 6d 65 74 68 6f 64 73 20 66 6f 72 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f n.methods.for.<see.cref="InputCo
12a0 6e 74 72 6f 6c 22 2f 3e 2e 20 4d 6f 73 74 6c 79 20 6c 6f 77 2d 6c 65 76 65 6c 20 72 6f 75 74 69 ntrol"/>..Mostly.low-level.routi
12c0 6e 65 73 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 70 75 nes.......///.</summary>......pu
12e0 62 6c 69 63 20 73 74 61 74 69 63 20 63 6c 61 73 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 45 78 blic.static.class.InputControlEx
1300 74 65 6e 73 69 6f 6e 73 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 tensions......{..........///.<su
1320 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 69 6e 64 20 61 20 63 6f 6e 74 72 mmary>..........///.Find.a.contr
1340 6f 6c 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 74 79 70 65 20 69 6e 20 63 6f 6e 74 72 6f 6c 20 ol.of.the.given.type.in.control.
1360 68 69 65 72 61 72 63 68 79 20 6f 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e hierarchy.of.<paramref.name="con
1380 74 72 6f 6c 22 2f 3e 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 trol"/>...........///.</summary>
13a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 ..........///.<param.name="contr
13c0 6f 6c 22 3e 43 6f 6e 74 72 6f 6c 20 77 68 6f 73 65 20 70 61 72 65 6e 74 73 20 74 6f 20 69 6e 73 ol">Control.whose.parents.to.ins
13e0 70 65 63 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 74 79 70 65 pect.</param>..........///.<type
1400 70 61 72 61 6d 20 6e 61 6d 65 3d 22 54 43 6f 6e 74 72 6f 6c 22 3e 54 79 70 65 20 6f 66 20 63 6f param.name="TControl">Type.of.co
1420 6e 74 72 6f 6c 20 74 6f 20 6c 6f 6f 6b 20 66 6f 72 2e 20 41 63 74 75 61 6c 20 63 6f 6e 74 72 6f ntrol.to.look.for..Actual.contro
1440 6c 20 74 79 70 65 20 63 61 6e 20 62 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 75 62 74 79 l.type.can.be..........///.subty
1460 70 65 20 6f 66 20 74 68 69 73 2e 3c 2f 74 79 70 65 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 pe.of.this.</typeparam>.........
1480 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 54 68 65 20 66 6f 75 6e 64 20 63 6f 6e 74 72 6f 6c 20 .///.<remarks>The.found.control.
14a0 6f 66 20 74 79 70 65 20 3c 74 79 70 65 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 54 43 6f 6e of.type.<typeparamref.name="TCon
14c0 74 72 6f 6c 22 2f 3e 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 65 69 74 68 65 72 0d 0a 20 20 20 trol"/>.which.may.be.either.....
14e0 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c .....///.<paramref.name="control
1500 22 2f 3e 20 69 74 73 65 6c 66 20 6f 72 20 6f 6e 65 20 6f 66 20 69 74 73 20 70 61 72 65 6e 74 73 "/>.itself.or.one.of.its.parents
1520 2e 20 49 66 20 6e 6f 20 73 75 63 68 20 63 6f 6e 74 72 6f 6c 20 77 61 73 20 66 6f 75 6e 64 2c 0d ..If.no.such.control.was.found,.
1540 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 65 74 75 72 6e 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e .........///.returns.<c>null</c>
1560 2e 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 .</remarks>..........///.<except
1580 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 ion.cref="ArgumentNullException"
15a0 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 69 73 20 3c ><paramref.name="control"/>.is.<
15c0 63 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 c>null</c>.</exception>.........
15e0 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 54 43 6f 6e 74 72 6f 6c 20 46 69 6e 64 49 6e 50 61 .public.static.TControl.FindInPa
1600 72 65 6e 74 43 68 61 69 6e 3c 54 43 6f 6e 74 72 6f 6c 3e 28 74 68 69 73 20 49 6e 70 75 74 43 6f rentChain<TControl>(this.InputCo
1620 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 ntrol.control)..............wher
1640 65 20 54 43 6f 6e 74 72 6f 6c 20 3a 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 0d 0a 20 20 20 20 20 e.TControl.:.InputControl.......
1660 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.==
1680 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
16a0 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
16c0 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 66 6f 72 20 28 76 61 ontrol));................for.(va
16e0 72 20 70 61 72 65 6e 74 20 3d 20 63 6f 6e 74 72 6f 6c 3b 20 70 61 72 65 6e 74 20 21 3d 20 6e 75 r.parent.=.control;.parent.!=.nu
1700 6c 6c 3b 20 70 61 72 65 6e 74 20 3d 20 70 61 72 65 6e 74 2e 70 61 72 65 6e 74 29 0d 0a 20 20 20 ll;.parent.=.parent.parent).....
1720 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 72 65 6e 74 20 69 73 20 54 43 6f 6e 74 .............if.(parent.is.TCont
1740 72 6f 6c 20 70 61 72 65 6e 74 4f 66 54 79 70 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 rol.parentOfType)...............
1760 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 70 61 72 65 6e 74 4f 66 54 79 70 65 3b 0d 0a 0d 0a 20 .......return.parentOfType;.....
1780 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 ...........return.null;.........
17a0 20 7d 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 .}............///.<summary>.....
17c0 20 20 20 20 20 2f 2f 2f 20 43 68 65 63 6b 20 77 68 65 74 68 65 72 20 74 68 65 20 67 69 76 65 6e .....///.Check.whether.the.given
17e0 20 63 6f 6e 74 72 6f 6c 20 69 73 20 63 6f 6e 73 69 64 65 72 65 64 20 70 72 65 73 73 65 64 20 61 .control.is.considered.pressed.a
1800 63 63 6f 72 64 69 6e 67 20 74 6f 20 74 68 65 20 62 75 74 74 6f 6e 20 70 72 65 73 73 20 74 68 72 ccording.to.the.button.press.thr
1820 65 73 68 6f 6c 64 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 eshold...........///.</summary>.
1840 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f .........///.<param.name="contro
1860 6c 22 3e 43 6f 6e 74 72 6f 6c 20 74 6f 20 63 68 65 63 6b 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 l">Control.to.check.</param>....
1880 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 62 75 74 74 6f 6e 50 72 65 ......///.<param.name="buttonPre
18a0 73 73 50 6f 69 6e 74 22 3e 4f 70 74 69 6f 6e 61 6c 20 63 75 73 74 6f 6d 20 62 75 74 74 6f 6e 20 ssPoint">Optional.custom.button.
18c0 70 72 65 73 73 20 70 6f 69 6e 74 2e 20 49 66 20 6e 6f 74 20 73 75 70 70 6c 69 65 64 2c 20 3c 73 press.point..If.not.supplied,.<s
18e0 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 65 74 74 69 6e 67 73 2e 64 65 66 61 75 6c 74 42 75 ee.cref="InputSettings.defaultBu
1900 74 74 6f 6e 50 72 65 73 73 50 6f 69 6e 74 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 ttonPressPoint"/>..........///.i
1920 73 20 75 73 65 64 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 s.used.</param>..........///.<re
1940 74 75 72 6e 73 3e 54 72 75 65 20 69 66 20 74 68 65 20 61 63 74 75 61 74 69 6f 6e 20 6f 66 20 74 turns>True.if.the.actuation.of.t
1960 68 65 20 67 69 76 65 6e 20 63 6f 6e 74 72 6f 6c 20 69 73 20 68 69 67 68 20 65 6e 6f 75 67 68 20 he.given.control.is.high.enough.
1980 66 6f 72 20 69 74 20 74 6f 20 62 65 20 63 6f 6e 73 69 64 65 72 65 64 20 70 72 65 73 73 65 64 2e for.it.to.be.considered.pressed.
19a0 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 </returns>..........///.<excepti
19c0 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e on.cref="ArgumentNullException">
19e0 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 69 73 20 3c 63 <paramref.name="control"/>.is.<c
1a00 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 >null</c>.</exception>..........
1a20 2f 2f 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 54 68 69 73 20 ///.<remarks>..........///.This.
1a40 6d 65 74 68 6f 64 20 63 68 65 63 6b 73 20 74 68 65 20 61 63 74 75 61 74 69 6f 6e 20 6c 65 76 65 method.checks.the.actuation.leve
1a60 6c 20 6f 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 61 73 20 3c 73 65 65 20 63 72 65 66 3d 22 49 l.of.the.control.as.<see.cref="I
1a80 73 41 63 74 75 61 74 65 64 22 2f 3e 20 64 6f 65 73 2e 20 46 6f 72 20 3c 73 65 65 20 63 72 65 66 sActuated"/>.does..For.<see.cref
1aa0 3d 22 43 6f 6e 74 72 6f 6c 73 2e 42 75 74 74 6f 6e 43 6f 6e 74 72 6f 6c 22 2f 3e 73 0d 0a 20 20 ="Controls.ButtonControl"/>s....
1ac0 20 20 20 20 20 20 2f 2f 2f 20 61 6e 64 20 6f 74 68 65 72 20 3c 63 3e 66 6c 6f 61 74 3c 2f 63 3e ......///.and.other.<c>float</c>
1ae0 20 76 61 6c 75 65 20 63 6f 6e 74 72 6f 6c 73 2c 20 74 68 69 73 20 77 69 6c 6c 20 65 66 66 65 63 .value.controls,.this.will.effec
1b00 74 69 76 65 6c 79 20 63 68 65 63 6b 20 77 68 65 74 68 65 72 20 74 68 65 20 66 6c 6f 61 74 20 76 tively.check.whether.the.float.v
1b20 61 6c 75 65 20 6f 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 65 78 63 65 65 64 73 20 74 68 65 20 alue.of.the.control.exceeds.the.
1b40 62 75 74 74 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 70 6f 69 6e 74 20 74 68 72 65 73 68 button..........///.point.thresh
1b60 6f 6c 64 2e 20 4e 6f 74 65 20 74 68 61 74 20 69 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 69 73 old..Note.that.if.the.control.is
1b80 20 61 6e 20 61 78 69 73 20 74 68 61 74 20 63 61 6e 20 62 65 20 62 6f 74 68 20 70 6f 73 69 74 69 .an.axis.that.can.be.both.positi
1ba0 76 65 20 61 6e 64 20 6e 65 67 61 74 69 76 65 2c 20 74 68 65 20 70 72 65 73 73 20 74 68 72 65 73 ve.and.negative,.the.press.thres
1bc0 68 6f 6c 64 20 77 6f 72 6b 73 20 69 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 6f 74 68 20 hold.works.in..........///.both.
1be0 64 69 72 65 63 74 69 6f 6e 73 2c 20 69 2e 65 2e 20 69 74 20 63 61 6e 20 62 65 20 63 72 6f 73 73 directions,.i.e..it.can.be.cross
1c00 65 64 20 62 6f 74 68 20 69 6e 20 74 68 65 20 70 6f 73 69 74 69 76 65 20 64 69 72 65 63 74 69 6f ed.both.in.the.positive.directio
1c20 6e 20 61 6e 64 20 69 6e 20 74 68 65 20 6e 65 67 61 74 69 76 65 20 64 69 72 65 63 74 69 6f 6e 2e n.and.in.the.negative.direction.
1c40 0d 0a 20 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 ..........///.</remarks>........
1c60 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 73 41 63 74 75 61 74 65 64 22 ..///.<seealso.cref="IsActuated"
1c80 2f 3e 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 49 />..........///.<seealso.cref="I
1ca0 6e 70 75 74 53 65 74 74 69 6e 67 73 2e 64 65 66 61 75 6c 74 42 75 74 74 6f 6e 50 72 65 73 73 50 nputSettings.defaultButtonPressP
1cc0 6f 69 6e 74 22 2f 3e 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 oint"/>..........///.<seealso.cr
1ce0 65 66 3d 22 49 6e 70 75 74 53 79 73 74 65 6d 2e 73 65 74 74 69 6e 67 73 22 2f 3e 0d 0a 20 20 20 ef="InputSystem.settings"/>.....
1d00 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 49 73 50 72 65 73 73 65 .....public.static.bool.IsPresse
1d20 64 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 66 6c 6f d(this.InputControl.control,.flo
1d40 61 74 20 62 75 74 74 6f 6e 50 72 65 73 73 50 6f 69 6e 74 20 3d 20 30 29 0d 0a 20 20 20 20 20 20 at.buttonPressPoint.=.0)........
1d60 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 20 ..{..............if.(control.==.
1d80 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 77 null)..................throw.new
1da0 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 6f .ArgumentNullException(nameof(co
1dc0 6e 74 72 6f 6c 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 4d 61 74 68 66 2e ntrol));..............if.(Mathf.
1de0 41 70 70 72 6f 78 69 6d 61 74 65 6c 79 28 30 2c 20 62 75 74 74 6f 6e 50 72 65 73 73 50 6f 69 6e Approximately(0,.buttonPressPoin
1e00 74 29 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 t))..............{..............
1e20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 69 73 20 42 75 74 74 6f 6e 43 6f 6e 74 72 6f 6c ....if.(control.is.ButtonControl
1e40 20 62 75 74 74 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 75 .button)......................bu
1e60 74 74 6f 6e 50 72 65 73 73 50 6f 69 6e 74 20 3d 20 62 75 74 74 6f 6e 2e 70 72 65 73 73 50 6f 69 ttonPressPoint.=.button.pressPoi
1e80 6e 74 4f 72 44 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 65 6c ntOrDefault;..................el
1ea0 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 75 74 74 6f 6e 50 72 se......................buttonPr
1ec0 65 73 73 50 6f 69 6e 74 20 3d 20 42 75 74 74 6f 6e 43 6f 6e 74 72 6f 6c 2e 73 5f 47 6c 6f 62 61 essPoint.=.ButtonControl.s_Globa
1ee0 6c 44 65 66 61 75 6c 74 42 75 74 74 6f 6e 50 72 65 73 73 50 6f 69 6e 74 3b 0d 0a 20 20 20 20 20 lDefaultButtonPressPoint;.......
1f00 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6f 6e .......}..............return.con
1f20 74 72 6f 6c 2e 49 73 41 63 74 75 61 74 65 64 28 62 75 74 74 6f 6e 50 72 65 73 73 50 6f 69 6e 74 trol.IsActuated(buttonPressPoint
1f40 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 2f 2f 2f 20 3c 73 75 );..........}............///.<su
1f60 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 74 75 72 6e 20 74 72 75 65 20 mmary>..........///.Return.true.
1f80 69 66 20 74 68 65 20 67 69 76 65 6e 20 63 6f 6e 74 72 6f 6c 20 69 73 20 61 63 74 75 61 74 65 64 if.the.given.control.is.actuated
1fa0 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 0a 20 20 20 20 20 ...........///.</summary>.......
1fc0 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 3e 3c 2f 70 ...///.<param.name="control"></p
1fe0 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 aram>..........///.<param.name="
2000 74 68 72 65 73 68 6f 6c 64 22 3e 4d 61 67 6e 69 74 75 64 65 20 74 68 72 65 73 68 6f 6c 64 20 74 threshold">Magnitude.threshold.t
2020 68 61 74 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 6d 75 73 74 20 6d 61 74 63 68 20 6f 72 20 65 78 hat.the.control.must.match.or.ex
2040 63 65 65 64 20 74 6f 20 62 65 20 63 6f 6e 73 69 64 65 72 65 64 20 61 63 74 75 61 74 65 64 2e 0d ceed.to.be.considered.actuated..
2060 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 6e 20 65 78 63 65 70 74 69 6f 6e 20 74 6f 20 74 68 69 .........///.An.exception.to.thi
2080 73 20 69 73 20 74 68 65 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65 20 6f 66 20 7a 65 72 6f 2e 20 s.is.the.default.value.of.zero..
20a0 49 66 20 74 68 72 65 73 68 6f 6c 64 20 69 73 20 7a 65 72 6f 2c 20 74 68 65 20 63 6f 6e 74 72 6f If.threshold.is.zero,.the.contro
20c0 6c 20 6d 75 73 74 20 68 61 76 65 20 61 20 6d 61 67 6e 69 74 75 64 65 0d 0a 20 20 20 20 20 20 20 l.must.have.a.magnitude.........
20e0 20 2f 2f 2f 20 67 72 65 61 74 65 72 20 74 68 61 6e 20 7a 65 72 6f 2e 3c 2f 70 61 72 61 6d 3e 0d .///.greater.than.zero.</param>.
2100 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e .........///.<returns></returns>
2120 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>.........
2140 20 2f 2f 2f 20 41 63 74 75 61 74 69 6f 6e 20 69 73 20 64 65 66 69 6e 65 64 20 61 73 20 61 20 63 .///.Actuation.is.defined.as.a.c
2160 6f 6e 74 72 6f 6c 20 68 61 76 69 6e 67 20 61 20 6d 61 67 6e 69 74 75 64 65 20 28 3c 73 65 65 20 ontrol.having.a.magnitude.(<see.
2180 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 45 76 61 6c 75 61 74 65 4d 61 67 6e 69 cref="InputControl.EvaluateMagni
21a0 74 75 64 65 28 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 67 72 65 61 74 65 72 20 74 tude()"/>..........///.greater.t
21c0 68 61 6e 20 7a 65 72 6f 20 6f 72 2c 20 69 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 64 6f 65 73 han.zero.or,.if.the.control.does
21e0 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 6d 61 67 6e 69 74 75 64 65 73 2c 20 68 61 73 20 62 65 65 .not.support.magnitudes,.has.bee
2200 6e 20 6d 6f 76 65 64 20 66 72 6f 6d 20 69 74 73 20 64 65 66 61 75 6c 74 0d 0a 20 20 20 20 20 20 n.moved.from.its.default........
2220 20 20 2f 2f 2f 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 ..///.state...........///.......
2240 20 20 20 2f 2f 2f 20 49 6e 20 70 72 61 63 74 69 63 65 2c 20 74 68 69 73 20 6d 65 61 6e 73 20 74 ...///.In.practice,.this.means.t
2260 68 61 74 20 77 68 65 6e 20 61 63 74 75 61 74 65 64 2c 20 61 20 63 6f 6e 74 72 6f 6c 20 77 69 6c hat.when.actuated,.a.control.wil
2280 6c 20 70 72 6f 64 75 63 65 20 61 20 76 61 6c 75 65 20 6f 74 68 65 72 20 74 68 61 6e 20 69 74 73 l.produce.a.value.other.than.its
22a0 20 64 65 66 61 75 6c 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 6c 75 65 2e 0d 0a 20 20 .default..........///.value.....
22c0 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 75 ......///.</remarks>..........pu
22e0 62 6c 69 63 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 49 73 41 63 74 75 61 74 65 64 28 74 68 69 73 blic.static.bool.IsActuated(this
2300 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 66 6c 6f 61 74 20 74 68 72 .InputControl.control,.float.thr
2320 65 73 68 6f 6c 64 20 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 eshold.=.0)..........{..........
2340 20 20 20 20 2f 2f 20 46 69 72 73 74 20 70 65 72 66 6f 72 6d 20 63 68 65 61 70 20 6d 65 6d 6f 72 ....//.First.perform.cheap.memor
2360 79 20 63 68 65 63 6b 2e 20 49 66 20 77 65 27 72 65 20 69 6e 20 64 65 66 61 75 6c 74 20 73 74 61 y.check..If.we're.in.default.sta
2380 74 65 2c 20 77 65 20 64 6f 6e 27 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6e 65 65 te,.we.don't..............//.nee
23a0 64 20 74 6f 20 69 6e 76 6f 6b 65 20 76 69 72 74 75 61 6c 73 20 6f 6e 20 74 68 65 20 63 6f 6e 74 d.to.invoke.virtuals.on.the.cont
23c0 72 6f 6c 2e 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 2e 43 68 rol...............if.(control.Ch
23e0 65 63 6b 53 74 61 74 65 49 73 41 74 44 65 66 61 75 6c 74 28 29 29 0d 0a 20 20 20 20 20 20 20 20 eckStateIsAtDefault())..........
2400 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ........return.false;...........
2420 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 6d 61 67 6e 69 74 75 64 65 20 6f 66 20 61 63 74 75 61 .....//.Check.magnitude.of.actua
2440 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6d 61 67 6e 69 74 75 64 65 tion...............var.magnitude
2460 20 3d 20 63 6f 6e 74 72 6f 6c 2e 45 76 61 6c 75 61 74 65 4d 61 67 6e 69 74 75 64 65 28 29 3b 0d .=.control.EvaluateMagnitude();.
2480 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 61 67 6e 69 74 75 64 65 20 3c 20 30 29 0d .............if.(magnitude.<.0).
24a0 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 20 .............{..................
24c0 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 77 65 20 70 72 6f 62 61 62 6c 79 20 77 61 6e 74 20 74 6f 20 ////REVIEW:.we.probably.want.to.
24e0 64 6f 20 61 20 76 61 6c 75 65 20 63 6f 6d 70 61 72 69 73 6f 6e 20 6f 6e 20 74 68 69 73 20 70 61 do.a.value.comparison.on.this.pa
2500 74 68 20 74 6f 20 63 6f 6d 70 61 72 65 20 69 74 20 74 6f 20 74 68 65 20 64 65 66 61 75 6c 74 20 th.to.compare.it.to.the.default.
2520 76 61 6c 75 65 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 74 72 value..................return.tr
2540 75 65 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 20 20 ue;..............}..............
2560 20 20 69 66 20 28 4d 61 74 68 66 2e 41 70 70 72 6f 78 69 6d 61 74 65 6c 79 28 74 68 72 65 73 68 ..if.(Mathf.Approximately(thresh
2580 6f 6c 64 2c 20 30 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e old,.0))..................return
25a0 20 6d 61 67 6e 69 74 75 64 65 20 3e 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 .magnitude.>.0;................r
25c0 65 74 75 72 6e 20 6d 61 67 6e 69 74 75 64 65 20 3e 3d 20 74 68 72 65 73 68 6f 6c 64 3b 0d 0a 20 eturn.magnitude.>=.threshold;...
25e0 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 .......}............///.<summary
2600 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 61 64 20 74 68 65 20 63 75 72 72 65 6e 74 20 >..........///.Read.the.current.
2620 76 61 6c 75 65 20 6f 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 61 6e 64 20 72 65 74 75 72 6e 20 value.of.the.control.and.return.
2640 69 74 20 61 73 20 61 6e 20 6f 62 6a 65 63 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f it.as.an.object...........///.</
2660 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c summary>..........///.<returns><
2680 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e /returns>..........///.<remarks>
26a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 61 6c 6c 6f 63 61 ..........///.This.method.alloca
26c0 74 65 73 20 47 43 20 6d 65 6d 6f 72 79 20 61 6e 64 20 74 68 75 73 20 6d 61 79 20 63 61 75 73 65 tes.GC.memory.and.thus.may.cause
26e0 20 67 61 72 62 61 67 65 20 63 6f 6c 6c 65 63 74 69 6f 6e 20 77 68 65 6e 20 75 73 65 64 20 64 75 .garbage.collection.when.used.du
2700 72 69 6e 67 20 67 61 6d 65 70 6c 61 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 ring.gameplay...........///.....
2720 20 20 20 20 20 2f 2f 2f 20 55 73 65 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 61 64 .....///.Use.<seealso.cref="Read
2740 56 61 6c 75 65 49 6e 74 6f 42 75 66 66 65 72 22 2f 3e 20 74 6f 20 72 65 61 64 20 76 61 6c 75 65 ValueIntoBuffer"/>.to.read.value
2760 73 20 67 65 6e 65 72 69 63 61 6c 6c 79 20 77 69 74 68 6f 75 74 20 68 61 76 69 6e 67 20 74 6f 20 s.generically.without.having.to.
2780 6b 6e 6f 77 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 70 65 63 69 66 69 63 20 76 know.the..........///.specific.v
27a0 61 6c 75 65 20 74 79 70 65 20 6f 66 20 61 20 63 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 20 alue.type.of.a.control..........
27c0 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 2f 20 3c 73 65 .///.</remarks>..........///.<se
27e0 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 61 64 56 61 6c 75 65 49 6e 74 6f 42 75 66 66 65 72 22 ealso.cref="ReadValueIntoBuffer"
2800 2f 3e 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 49 />..........///.<seealso.cref="I
2820 6e 70 75 74 43 6f 6e 74 72 6f 6c 7b 54 56 61 6c 75 65 7d 2e 52 65 61 64 56 61 6c 75 65 22 2f 3e nputControl{TValue}.ReadValue"/>
2840 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 6f ..........public.static.unsafe.o
2860 62 6a 65 63 74 20 52 65 61 64 56 61 6c 75 65 41 73 4f 62 6a 65 63 74 28 74 68 69 73 20 49 6e 70 bject.ReadValueAsObject(this.Inp
2880 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 20 20 20 7b 0d 0a 20 utControl.control)..........{...
28a0 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 20 6e 75 6c 6c 29 0d ...........if.(control.==.null).
28c0 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 41 72 67 75 6d .................throw.new.Argum
28e0 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 6f 6e 74 72 6f 6c 29 entNullException(nameof(control)
2900 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 63 6f 6e 74 72 6f 6c );................return.control
2920 2e 52 65 61 64 56 61 6c 75 65 46 72 6f 6d 53 74 61 74 65 41 73 4f 62 6a 65 63 74 28 63 6f 6e 74 .ReadValueFromStateAsObject(cont
2940 72 6f 6c 2e 63 75 72 72 65 6e 74 53 74 61 74 65 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d rol.currentStatePtr);..........}
2960 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>.......
2980 20 20 20 2f 2f 2f 20 52 65 61 64 20 74 68 65 20 63 75 72 72 65 6e 74 2c 20 70 72 6f 63 65 73 73 ...///.Read.the.current,.process
29a0 65 64 20 76 61 6c 75 65 20 6f 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 61 6e 64 20 73 74 6f 72 ed.value.of.the.control.and.stor
29c0 65 20 69 74 20 69 6e 74 6f 20 74 68 65 20 67 69 76 65 6e 20 6d 65 6d 6f 72 79 20 62 75 66 66 65 e.it.into.the.given.memory.buffe
29e0 72 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 0a 20 20 20 20 r...........///.</summary>......
2a00 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 62 75 66 66 65 72 22 3e 42 75 66 ....///.<param.name="buffer">Buf
2a20 66 65 72 20 74 6f 20 73 74 6f 72 65 20 76 61 6c 75 65 20 69 6e 2e 20 4e 6f 74 65 20 74 68 61 74 fer.to.store.value.in..Note.that
2a40 20 74 68 65 20 76 61 6c 75 65 20 69 73 20 6e 6f 74 20 73 74 6f 72 65 64 20 77 69 74 68 20 74 68 .the.value.is.not.stored.with.th
2a60 65 20 6f 66 66 73 65 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 66 6f 75 6e 64 20 69 6e 20 3c e.offset..........///.found.in.<
2a80 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 see.cref="InputStateBlock.byteOf
2aa0 66 73 65 74 22 2f 3e 20 6f 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 27 73 20 3c 73 65 65 20 63 72 fset"/>.of.the.control's.<see.cr
2ac0 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 22 2f 3e 2e 20 ef="InputControl.stateBlock"/>..
2ae0 49 74 20 77 69 6c 6c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 65 20 73 74 6f 72 65 64 20 64 It.will..........///.be.stored.d
2b00 69 72 65 63 74 6c 79 20 61 74 20 74 68 65 20 67 69 76 65 6e 20 61 64 64 72 65 73 73 2e 3c 2f 70 irectly.at.the.given.address.</p
2b20 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 aram>..........///.<param.name="
2b40 62 75 66 66 65 72 53 69 7a 65 22 3e 53 69 7a 65 20 6f 66 20 74 68 65 20 6d 65 6d 6f 72 79 20 61 bufferSize">Size.of.the.memory.a
2b60 76 61 69 6c 61 62 6c 65 20 61 74 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 62 75 66 66 vailable.at.<paramref.name="buff
2b80 65 72 22 2f 3e 20 69 6e 20 62 79 74 65 73 2e 20 48 61 73 20 74 6f 20 62 65 0d 0a 20 20 20 20 20 er"/>.in.bytes..Has.to.be.......
2ba0 20 20 20 2f 2f 2f 20 61 74 20 6c 65 61 73 74 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 ...///.at.least.<see.cref="Input
2bc0 43 6f 6e 74 72 6f 6c 2e 76 61 6c 75 65 53 69 7a 65 49 6e 42 79 74 65 73 22 2f 3e 2e 20 49 66 20 Control.valueSizeInBytes"/>..If.
2be0 74 68 65 20 73 69 7a 65 20 69 73 20 73 6d 61 6c 6c 65 72 2c 20 6e 6f 74 68 69 6e 67 20 77 69 6c the.size.is.smaller,.nothing.wil
2c00 6c 20 62 65 20 77 72 69 74 74 65 6e 20 74 6f 20 74 68 65 20 62 75 66 66 65 72 2e 3c 2f 70 61 72 l.be.written.to.the.buffer.</par
2c20 61 6d 3e 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 am>..........///.<seealso.cref="
2c40 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 76 61 6c 75 65 53 69 7a 65 49 6e 42 79 74 65 73 22 2f 3e InputControl.valueSizeInBytes"/>
2c60 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 49 6e 70 ..........///.<seealso.cref="Inp
2c80 75 74 43 6f 6e 74 72 6f 6c 2e 76 61 6c 75 65 54 79 70 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 utControl.valueType"/>..........
2ca0 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e ///.<seealso.cref="InputControl.
2cc0 52 65 61 64 56 61 6c 75 65 46 72 6f 6d 53 74 61 74 65 49 6e 74 6f 42 75 66 66 65 72 22 2f 3e 0d ReadValueFromStateIntoBuffer"/>.
2ce0 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 76 6f .........public.static.unsafe.vo
2d00 69 64 20 52 65 61 64 56 61 6c 75 65 49 6e 74 6f 42 75 66 66 65 72 28 74 68 69 73 20 49 6e 70 75 id.ReadValueIntoBuffer(this.Inpu
2d20 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 76 6f 69 64 2a 20 62 75 66 66 65 72 2c 20 tControl.control,.void*.buffer,.
2d40 69 6e 74 20 62 75 66 66 65 72 53 69 7a 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 int.bufferSize)..........{......
2d60 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 ........if.(control.==.null)....
2d80 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
2da0 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d NullException(nameof(control));.
2dc0 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 62 75 66 66 65 72 20 3d 3d 20 6e 75 6c 6c 29 .............if.(buffer.==.null)
2de0 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 41 72 67 75 ..................throw.new.Argu
2e00 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 62 75 66 66 65 72 29 mentNullException(nameof(buffer)
2e20 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 52 65 61 64 56 61 );................control.ReadVa
2e40 6c 75 65 46 72 6f 6d 53 74 61 74 65 49 6e 74 6f 42 75 66 66 65 72 28 63 6f 6e 74 72 6f 6c 2e 63 lueFromStateIntoBuffer(control.c
2e60 75 72 72 65 6e 74 53 74 61 74 65 50 74 72 2c 20 62 75 66 66 65 72 2c 20 62 75 66 66 65 72 53 69 urrentStatePtr,.buffer,.bufferSi
2e80 7a 65 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 2f 2f 2f 20 3c ze);..........}............///.<
2ea0 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 61 64 20 74 68 65 20 63 summary>..........///.Read.the.c
2ec0 6f 6e 74 72 6f 6c 27 73 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65 20 61 6e 64 20 72 65 74 75 72 ontrol's.default.value.and.retur
2ee0 6e 20 69 74 20 61 73 20 61 6e 20 6f 62 6a 65 63 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 n.it.as.an.object...........///.
2f00 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e </summary>..........///.<param.n
2f20 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 3e 43 6f 6e 74 72 6f 6c 20 74 6f 20 72 65 61 64 20 64 65 ame="control">Control.to.read.de
2f40 66 61 75 6c 74 20 76 61 6c 75 65 20 66 72 6f 6d 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 fault.value.from.</param>.......
2f60 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 ...///.<returns></returns>......
2f80 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e ....///.<exception.cref="Argumen
2fa0 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 tNullException"><paramref.name="
2fc0 63 6f 6e 74 72 6f 6c 22 2f 3e 20 69 73 20 6e 75 6c 6c 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d control"/>.is.null.</exception>.
2fe0 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 20 .........///.<remarks>..........
3000 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 61 6c 6c 6f 63 61 74 65 73 20 47 43 20 6d 65 6d ///.This.method.allocates.GC.mem
3020 6f 72 79 20 61 6e 64 20 73 68 6f 75 6c 64 20 74 68 75 73 20 6e 6f 74 20 62 65 20 75 73 65 64 20 ory.and.should.thus.not.be.used.
3040 64 75 72 69 6e 67 20 6e 6f 72 6d 61 6c 20 67 61 6d 65 70 6c 61 79 2e 0d 0a 20 20 20 20 20 20 20 during.normal.gameplay..........
3060 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 2f 20 3c 73 65 .///.</remarks>..........///.<se
3080 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 68 61 73 44 65 66 61 ealso.cref="InputControl.hasDefa
30a0 75 6c 74 53 74 61 74 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 ultState"/>..........///.<seeals
30c0 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 64 65 66 61 75 6c 74 53 74 61 74 o.cref="InputControl.defaultStat
30e0 65 50 74 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 ePtr"/>..........public.static.u
3100 6e 73 61 66 65 20 6f 62 6a 65 63 74 20 52 65 61 64 44 65 66 61 75 6c 74 56 61 6c 75 65 41 73 4f nsafe.object.ReadDefaultValueAsO
3120 62 6a 65 63 74 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 29 bject(this.InputControl.control)
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 69 66 20 28 63 6f 6e ..........{..............if.(con
3160 74 72 6f 6c 20 3d 3d 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 trol.==.null)..................t
3180 68 72 6f 77 20 6e 65 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 hrow.new.ArgumentNullException(n
31a0 61 6d 65 6f 66 28 63 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 ameof(control));................
31c0 72 65 74 75 72 6e 20 63 6f 6e 74 72 6f 6c 2e 52 65 61 64 56 61 6c 75 65 46 72 6f 6d 53 74 61 74 return.control.ReadValueFromStat
31e0 65 41 73 4f 62 6a 65 63 74 28 63 6f 6e 74 72 6f 6c 2e 64 65 66 61 75 6c 74 53 74 61 74 65 50 74 eAsObject(control.defaultStatePt
3200 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 2f 2f 2f 20 3c 73 r);..........}............///.<s
3220 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 61 64 20 74 68 65 20 76 61 ummary>..........///.Read.the.va
3240 6c 75 65 20 66 6f 72 20 74 68 65 20 67 69 76 65 6e 20 63 6f 6e 74 72 6f 6c 20 66 72 6f 6d 20 74 lue.for.the.given.control.from.t
3260 68 65 20 67 69 76 65 6e 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 he.given.event...........///.</s
3280 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 ummary>..........///.<param.name
32a0 3d 22 63 6f 6e 74 72 6f 6c 22 3e 43 6f 6e 74 72 6f 6c 20 74 6f 20 72 65 61 64 20 76 61 6c 75 65 ="control">Control.to.read.value
32c0 20 66 6f 72 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 .for.</param>..........///.<para
32e0 6d 20 6e 61 6d 65 3d 22 69 6e 70 75 74 45 76 65 6e 74 22 3e 45 76 65 6e 74 20 74 6f 20 72 65 61 m.name="inputEvent">Event.to.rea
3300 64 20 76 61 6c 75 65 20 66 72 6f 6d 2e 20 4d 75 73 74 20 62 65 20 61 20 3c 73 65 65 20 63 72 65 d.value.from..Must.be.a.<see.cre
3320 66 3d 22 53 74 61 74 65 45 76 65 6e 74 22 2f 3e 20 6f 72 20 3c 73 65 65 20 63 72 65 66 3d 22 44 f="StateEvent"/>.or.<see.cref="D
3340 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 eltaStateEvent"/>.</param>......
3360 20 20 20 20 2f 2f 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 ....///.<typeparam.name="TValue"
3380 3e 54 79 70 65 20 6f 66 20 76 61 6c 75 65 20 74 6f 20 72 65 61 64 2e 3c 2f 74 79 70 65 70 61 72 >Type.of.value.to.read.</typepar
33a0 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 am>..........///.<exception.cref
33c0 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 ="ArgumentNullException"><paramr
33e0 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f ef.name="control"/>.is.<c>null</
3400 63 3e 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 2f 20 3c 65 78 c>.</exception>..........///.<ex
3420 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 6e 22 ception.cref="ArgumentException"
3440 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 69 6e 70 75 74 45 76 65 6e 74 22 2f 3e 20 69 ><paramref.name="inputEvent"/>.i
3460 73 20 6e 6f 74 20 61 20 3c 73 65 65 20 63 72 65 66 3d 22 53 74 61 74 65 45 76 65 6e 74 22 2f 3e s.not.a.<see.cref="StateEvent"/>
3480 20 6f 72 20 3c 73 65 65 20 63 72 65 66 3d 22 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 22 2f .or.<see.cref="DeltaStateEvent"/
34a0 3e 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 2f 20 3c 72 65 74 >.</exception>..........///.<ret
34c0 75 72 6e 73 3e 54 68 65 20 76 61 6c 75 65 20 66 6f 72 20 74 68 65 20 67 69 76 65 6e 20 63 6f 6e urns>The.value.for.the.given.con
34e0 74 72 6f 6c 20 61 73 20 72 65 61 64 20 6f 75 74 20 66 72 6f 6d 20 74 68 65 20 67 69 76 65 6e 20 trol.as.read.out.from.the.given.
3500 65 76 65 6e 74 20 6f 72 20 3c 63 3e 64 65 66 61 75 6c 74 28 54 56 61 6c 75 65 29 3c 2f 63 3e 20 event.or.<c>default(TValue)</c>.
3520 69 66 20 74 68 65 20 67 69 76 65 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 65 76 65 6e 74 20 if.the.given..........///.event.
3540 64 6f 65 73 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 61 20 76 61 6c 75 65 20 66 6f 72 20 74 68 65 does.not.contain.a.value.for.the
3560 20 63 6f 6e 74 72 6f 6c 20 28 65 2e 67 2e 20 69 66 20 69 74 20 69 73 20 61 20 3c 73 65 65 20 63 .control.(e.g..if.it.is.a.<see.c
3580 72 65 66 3d 22 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 22 2f 3e 20 6e 6f 74 20 63 6f 6e 74 ref="DeltaStateEvent"/>.not.cont
35a0 61 69 6e 69 6e 67 20 74 68 65 20 72 65 6c 65 76 61 6e 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f aining.the.relevant..........///
35c0 20 70 6f 72 74 69 6f 6e 20 6f 66 20 74 68 65 20 64 65 76 69 63 65 27 73 20 73 74 61 74 65 20 6d .portion.of.the.device's.state.m
35e0 65 6d 6f 72 79 29 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 emory).</returns>..........publi
3600 63 20 73 74 61 74 69 63 20 54 56 61 6c 75 65 20 52 65 61 64 56 61 6c 75 65 46 72 6f 6d 45 76 65 c.static.TValue.ReadValueFromEve
3620 6e 74 3c 54 56 61 6c 75 65 3e 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3c 54 56 61 nt<TValue>(this.InputControl<TVa
3640 6c 75 65 3e 20 63 6f 6e 74 72 6f 6c 2c 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 20 69 6e 70 75 lue>.control,.InputEventPtr.inpu
3660 74 45 76 65 6e 74 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 tEvent)..............where.TValu
3680 65 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 e.:.struct..........{...........
36a0 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 ...if.(control.==.null).........
36c0 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 4e 75 6c 6c 45 .........throw.new.ArgumentNullE
36e0 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 20 20 20 20 xception(nameof(control));......
3700 20 20 20 20 20 20 20 20 69 66 20 28 21 52 65 61 64 56 61 6c 75 65 46 72 6f 6d 45 76 65 6e 74 28 ........if.(!ReadValueFromEvent(
3720 63 6f 6e 74 72 6f 6c 2c 20 69 6e 70 75 74 45 76 65 6e 74 2c 20 6f 75 74 20 76 61 72 20 76 61 6c control,.inputEvent,.out.var.val
3740 75 65 29 29 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 64 65 66 ue))..................return.def
3760 61 75 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 76 61 6c 75 65 3b ault;..............return.value;
3780 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d ..........}............///.<summ
37a0 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 68 65 63 6b 20 69 66 20 74 68 65 20 67 ary>..........///.Check.if.the.g
37c0 69 76 65 6e 20 65 76 65 6e 74 20 63 6f 6e 74 61 69 6e 73 20 61 20 76 61 6c 75 65 20 66 6f 72 20 iven.event.contains.a.value.for.
37e0 74 68 65 20 67 69 76 65 6e 20 63 6f 6e 74 72 6f 6c 20 61 6e 64 20 69 66 20 73 6f 2c 20 72 65 61 the.given.control.and.if.so,.rea
3800 64 20 74 68 65 20 76 61 6c 75 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d d.the.value...........///.</summ
3820 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 ary>..........///.<param.name="c
3840 6f 6e 74 72 6f 6c 22 3e 43 6f 6e 74 72 6f 6c 20 74 6f 20 72 65 61 64 20 76 61 6c 75 65 20 66 6f ontrol">Control.to.read.value.fo
3860 72 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e r.</param>..........///.<param.n
3880 61 6d 65 3d 22 69 6e 70 75 74 45 76 65 6e 74 22 3e 49 6e 70 75 74 20 65 76 65 6e 74 2e 20 54 68 ame="inputEvent">Input.event..Th
38a0 69 73 20 6d 75 73 74 20 62 65 20 61 20 3c 73 65 65 20 63 72 65 66 3d 22 53 74 61 74 65 45 76 65 is.must.be.a.<see.cref="StateEve
38c0 6e 74 22 2f 3e 20 6f 72 20 3c 73 65 65 20 63 72 65 66 3d 22 44 65 6c 74 61 53 74 61 74 65 45 76 nt"/>.or.<see.cref="DeltaStateEv
38e0 65 6e 74 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 69 ent"/>...........///.Note.that.i
3900 6e 20 74 68 65 20 63 61 73 65 20 6f 66 20 61 20 3c 73 65 65 20 63 72 65 66 3d 22 44 65 6c 74 61 n.the.case.of.a.<see.cref="Delta
3920 53 74 61 74 65 45 76 65 6e 74 22 2f 3e 2c 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 6d 61 79 20 6e StateEvent"/>,.the.control.may.n
3940 6f 74 20 61 63 74 75 61 6c 6c 79 20 62 65 20 70 61 72 74 20 6f 66 20 74 68 65 20 65 76 65 6e 74 ot.actually.be.part.of.the.event
3960 2e 20 49 6e 20 74 68 69 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 61 73 65 2c 20 74 68 65 ..In.this..........///.case,.the
3980 20 6d 65 74 68 6f 64 20 72 65 74 75 72 6e 73 20 66 61 6c 73 65 20 61 6e 64 20 73 74 6f 72 65 73 .method.returns.false.and.stores
39a0 20 3c 63 3e 64 65 66 61 75 6c 74 28 54 56 61 6c 75 65 29 3c 2f 63 3e 20 69 6e 20 3c 70 61 72 61 .<c>default(TValue)</c>.in.<para
39c0 6d 72 65 66 20 6e 61 6d 65 3d 22 76 61 6c 75 65 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 mref.name="value"/>.</param>....
39e0 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 76 61 6c 75 65 22 3e 56 61 ......///.<param.name="value">Va
3a00 72 69 61 62 6c 65 20 74 68 61 74 20 72 65 63 65 69 76 65 73 20 74 68 65 20 63 6f 6e 74 72 6f 6c riable.that.receives.the.control
3a20 20 76 61 6c 75 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 74 79 .value.</param>..........///.<ty
3a40 70 65 70 61 72 61 6d 20 6e 61 6d 65 3d 22 54 56 61 6c 75 65 22 3e 54 79 70 65 20 6f 66 20 76 61 peparam.name="TValue">Type.of.va
3a60 6c 75 65 20 74 6f 20 72 65 61 64 2e 3c 2f 74 79 70 65 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 lue.to.read.</typeparam>........
3a80 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 72 75 65 20 69 66 20 74 68 65 20 76 61 6c 75 65 ..///.<returns>True.if.the.value
3aa0 20 68 61 73 20 62 65 65 6e 20 73 75 63 63 65 73 73 66 75 6c 6c 79 20 72 65 61 64 20 66 72 6f 6d .has.been.successfully.read.from
3ac0 20 74 68 65 20 65 76 65 6e 74 2c 20 66 61 6c 73 65 20 6f 74 68 65 72 77 69 73 65 2e 3c 2f 72 65 .the.event,.false.otherwise.</re
3ae0 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 turns>..........///.<exception.c
3b00 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 ref="ArgumentNullException"><par
3b20 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c amref.name="control"/>.is.<c>nul
3b40 6c 3c 2f 63 3e 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 2f 20 l</c>.</exception>..........///.
3b60 3c 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 <exception.cref="ArgumentExcepti
3b80 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 69 6e 70 75 74 45 76 65 6e 74 22 2f on"><paramref.name="inputEvent"/
3ba0 3e 20 69 73 20 6e 6f 74 20 61 20 3c 73 65 65 20 63 72 65 66 3d 22 53 74 61 74 65 45 76 65 6e 74 >.is.not.a.<see.cref="StateEvent
3bc0 22 2f 3e 20 6f 72 20 3c 73 65 65 20 63 72 65 66 3d 22 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e "/>.or.<see.cref="DeltaStateEven
3be0 74 22 2f 3e 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 2f 20 3c t"/>.</exception>..........///.<
3c00 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 61 64 55 6e 70 72 6f 63 65 73 73 65 64 56 61 6c seealso.cref="ReadUnprocessedVal
3c20 75 65 46 72 6f 6d 45 76 65 6e 74 7b 54 56 61 6c 75 65 7d 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c ueFromEvent{TValue}(InputControl
3c40 7b 54 56 61 6c 75 65 7d 2c 49 6e 70 75 74 45 76 65 6e 74 50 74 72 29 22 2f 3e 0d 0a 20 20 20 20 {TValue},InputEventPtr)"/>......
3c60 20 20 20 20 5b 53 79 73 74 65 6d 2e 44 69 61 67 6e 6f 73 74 69 63 73 2e 43 6f 64 65 41 6e 61 6c ....[System.Diagnostics.CodeAnal
3c80 79 73 69 73 2e 53 75 70 70 72 65 73 73 4d 65 73 73 61 67 65 28 22 4d 69 63 72 6f 73 6f 66 74 2e ysis.SuppressMessage("Microsoft.
3ca0 44 65 73 69 67 6e 22 2c 20 22 43 41 31 30 32 31 3a 41 76 6f 69 64 4f 75 74 50 61 72 61 6d 65 74 Design",."CA1021:AvoidOutParamet
3cc0 65 72 73 22 2c 20 4d 65 73 73 61 67 65 49 64 20 3d 20 22 32 23 22 29 5d 0d 0a 20 20 20 20 20 20 ers",.MessageId.=."2#")]........
3ce0 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 62 6f 6f 6c 20 52 65 61 64 ..public.static.unsafe.bool.Read
3d00 56 61 6c 75 65 46 72 6f 6d 45 76 65 6e 74 3c 54 56 61 6c 75 65 3e 28 74 68 69 73 20 49 6e 70 75 ValueFromEvent<TValue>(this.Inpu
3d20 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 49 6e 70 75 74 45 tControl<TValue>.control,.InputE
3d40 76 65 6e 74 50 74 72 20 69 6e 70 75 74 45 76 65 6e 74 2c 20 6f 75 74 20 54 56 61 6c 75 65 20 76 ventPtr.inputEvent,.out.TValue.v
3d60 61 6c 75 65 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 20 alue)..............where.TValue.
3d80 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 20 :.struct..........{.............
3da0 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 .if.(control.==.null)...........
3dc0 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 4e 75 6c 6c 45 78 63 .......throw.new.ArgumentNullExc
3de0 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 0d 0a 20 20 20 20 eption(nameof(control));........
3e00 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 74 65 50 74 72 20 3d 20 63 6f 6e 74 72 6f 6c 2e 47 ........var.statePtr.=.control.G
3e20 65 74 53 74 61 74 65 50 74 72 46 72 6f 6d 53 74 61 74 65 45 76 65 6e 74 28 69 6e 70 75 74 45 76 etStatePtrFromStateEvent(inputEv
3e40 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 61 74 65 50 74 72 20 ent);..............if.(statePtr.
3e60 3d 3d 20 6e 75 6c 6c 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 ==.null)..............{.........
3e80 20 20 20 20 20 20 20 20 20 76 61 6c 75 65 20 3d 20 63 6f 6e 74 72 6f 6c 2e 52 65 61 64 44 65 66 .........value.=.control.ReadDef
3ea0 61 75 6c 74 56 61 6c 75 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 aultValue();..................re
3ec0 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 7d 0d 0a 0d 0a 20 20 turn.false;..............}......
3ee0 20 20 20 20 20 20 20 20 20 20 76 61 6c 75 65 20 3d 20 63 6f 6e 74 72 6f 6c 2e 52 65 61 64 56 61 ..........value.=.control.ReadVa
3f00 6c 75 65 46 72 6f 6d 53 74 61 74 65 28 73 74 61 74 65 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 lueFromState(statePtr);.........
3f20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a .....return.true;..........}....
3f40 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 54 56 61 6c 75 65 20 52 65 61 ........public.static.TValue.Rea
3f60 64 55 6e 70 72 6f 63 65 73 73 65 64 56 61 6c 75 65 46 72 6f 6d 45 76 65 6e 74 3c 54 56 61 6c 75 dUnprocessedValueFromEvent<TValu
3f80 65 3e 28 74 68 69 73 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 e>(this.InputControl<TValue>.con
3fa0 74 72 6f 6c 2c 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 20 65 76 65 6e 74 50 74 72 29 0d 0a 20 trol,.InputEventPtr.eventPtr)...
3fc0 20 20 20 20 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 ...........where.TValue.:.struct
3fe0 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 20 28 63 6f 6e ..........{..............if.(con
4000 74 72 6f 6c 20 3d 3d 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 trol.==.null)..................t
4020 68 72 6f 77 20 6e 65 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 hrow.new.ArgumentNullException(n
4040 61 6d 65 6f 66 28 63 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 ameof(control));................
4060 76 61 72 20 72 65 73 75 6c 74 20 3d 20 64 65 66 61 75 6c 74 28 54 56 61 6c 75 65 29 3b 0d 0a 20 var.result.=.default(TValue);...
4080 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 52 65 61 64 55 6e 70 72 6f 63 65 73 73 ...........control.ReadUnprocess
40a0 65 64 56 61 6c 75 65 46 72 6f 6d 45 76 65 6e 74 28 65 76 65 6e 74 50 74 72 2c 20 6f 75 74 20 72 edValueFromEvent(eventPtr,.out.r
40c0 65 73 75 6c 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 72 65 73 75 esult);..............return.resu
40e0 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 79 73 74 65 lt;..........}............[Syste
4100 6d 2e 44 69 61 67 6e 6f 73 74 69 63 73 2e 43 6f 64 65 41 6e 61 6c 79 73 69 73 2e 53 75 70 70 72 m.Diagnostics.CodeAnalysis.Suppr
4120 65 73 73 4d 65 73 73 61 67 65 28 22 4d 69 63 72 6f 73 6f 66 74 2e 44 65 73 69 67 6e 22 2c 20 22 essMessage("Microsoft.Design",."
4140 43 41 31 30 32 31 3a 41 76 6f 69 64 4f 75 74 50 61 72 61 6d 65 74 65 72 73 22 2c 20 4d 65 73 73 CA1021:AvoidOutParameters",.Mess
4160 61 67 65 49 64 20 3d 20 22 32 23 22 29 5d 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 ageId.=."2#")]..........public.s
4180 74 61 74 69 63 20 75 6e 73 61 66 65 20 62 6f 6f 6c 20 52 65 61 64 55 6e 70 72 6f 63 65 73 73 65 tatic.unsafe.bool.ReadUnprocesse
41a0 64 56 61 6c 75 65 46 72 6f 6d 45 76 65 6e 74 3c 54 56 61 6c 75 65 3e 28 74 68 69 73 20 49 6e 70 dValueFromEvent<TValue>(this.Inp
41c0 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 49 6e 70 75 74 utControl<TValue>.control,.Input
41e0 45 76 65 6e 74 50 74 72 20 69 6e 70 75 74 45 76 65 6e 74 2c 20 6f 75 74 20 54 56 61 6c 75 65 20 EventPtr.inputEvent,.out.TValue.
4200 76 61 6c 75 65 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 value)..............where.TValue
4220 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..........{............
4240 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 ..if.(control.==.null)..........
4260 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 4e 75 6c 6c 45 78 ........throw.new.ArgumentNullEx
4280 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 0d 0a 20 20 20 ception(nameof(control));.......
42a0 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 74 65 50 74 72 20 3d 20 63 6f 6e 74 72 6f 6c 2e .........var.statePtr.=.control.
42c0 47 65 74 53 74 61 74 65 50 74 72 46 72 6f 6d 53 74 61 74 65 45 76 65 6e 74 28 69 6e 70 75 74 45 GetStatePtrFromStateEvent(inputE
42e0 76 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 61 74 65 50 74 72 vent);..............if.(statePtr
4300 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 .==.null)..............{........
4320 20 20 20 20 20 20 20 20 20 20 76 61 6c 75 65 20 3d 20 63 6f 6e 74 72 6f 6c 2e 52 65 61 64 44 65 ..........value.=.control.ReadDe
4340 66 61 75 6c 74 56 61 6c 75 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 faultValue();..................r
4360 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 7d 0d 0a 0d 0a 20 eturn.false;..............}.....
4380 20 20 20 20 20 20 20 20 20 20 20 76 61 6c 75 65 20 3d 20 63 6f 6e 74 72 6f 6c 2e 52 65 61 64 55 ...........value.=.control.ReadU
43a0 6e 70 72 6f 63 65 73 73 65 64 56 61 6c 75 65 46 72 6f 6d 53 74 61 74 65 28 73 74 61 74 65 50 74 nprocessedValueFromState(statePt
43c0 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 r);..............return.true;...
43e0 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 73 74 61 74 69 .......}............public.stati
4400 63 20 75 6e 73 61 66 65 20 76 6f 69 64 20 57 72 69 74 65 56 61 6c 75 65 46 72 6f 6d 4f 62 6a 65 c.unsafe.void.WriteValueFromObje
4420 63 74 49 6e 74 6f 45 76 65 6e 74 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f ctIntoEvent(this.InputControl.co
4440 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 74 50 74 72 2c 20 6f ntrol,.InputEventPtr.eventPtr,.o
4460 62 6a 65 63 74 20 76 61 6c 75 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 bject.value)..........{.........
4480 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 .....if.(control.==.null).......
44a0 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 4e 75 6c ...........throw.new.ArgumentNul
44c0 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 0d 0a lException(nameof(control));....
44e0 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 63 6f 6e 74 72 ............var.statePtr.=.contr
4500 6f 6c 2e 47 65 74 53 74 61 74 65 50 74 72 46 72 6f 6d 53 74 61 74 65 45 76 65 6e 74 28 65 76 65 ol.GetStatePtrFromStateEvent(eve
4520 6e 74 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 61 74 65 50 74 ntPtr);..............if.(statePt
4540 72 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 r.==.null)..................retu
4560 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 57 72 69 74 65 rn;................control.Write
4580 56 61 6c 75 65 46 72 6f 6d 4f 62 6a 65 63 74 49 6e 74 6f 53 74 61 74 65 28 76 61 6c 75 65 2c 20 ValueFromObjectIntoState(value,.
45a0 73 74 61 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 statePtr);..........}...........
45c0 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 57 72 69 74 .///.<summary>..........///.Writ
45e0 65 20 74 68 65 20 63 6f 6e 74 72 6f 6c 27 73 20 63 75 72 72 65 6e 74 20 76 61 6c 75 65 20 69 6e e.the.control's.current.value.in
4600 74 6f 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 61 74 65 50 74 72 22 2f 3e 2e 0d to.<paramref.name="statePtr"/>..
4620 0a 20 20 20 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 .........///.</summary>.........
4640 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 3e 43 6f 6e 74 72 .///.<param.name="control">Contr
4660 6f 6c 20 74 6f 20 72 65 61 64 20 74 68 65 20 63 75 72 72 65 6e 74 20 76 61 6c 75 65 20 66 72 6f ol.to.read.the.current.value.fro
4680 6d 20 61 6e 64 20 74 6f 20 73 74 6f 72 65 20 73 74 61 74 65 20 66 6f 72 20 69 6e 20 3c 70 61 72 m.and.to.store.state.for.in.<par
46a0 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 61 74 65 50 74 72 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e amref.name="statePtr"/>.</param>
46c0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 73 74 61 74 65 ..........///.<param.name="state
46e0 50 74 72 22 3e 53 74 61 74 65 20 74 6f 20 72 65 63 65 69 76 65 20 74 68 65 20 63 6f 6e 74 72 6f Ptr">State.to.receive.the.contro
4700 6c 27 73 20 76 61 6c 75 65 20 69 6e 20 69 74 73 20 72 65 73 70 65 63 74 69 76 65 20 3c 73 65 65 l's.value.in.its.respective.<see
4720 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 22 2f .cref="InputControl.stateBlock"/
4740 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 >.</param>..........///.<excepti
4760 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e on.cref="ArgumentNullException">
4780 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 69 73 20 6e 75 <paramref.name="control"/>.is.nu
47a0 6c 6c 20 6f 72 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 61 74 65 50 74 72 22 2f ll.or.<paramref.name="statePtr"/
47c0 3e 20 69 73 20 6e 75 6c 6c 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 >.is.null.</exception>..........
47e0 2f 2f 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 54 68 69 73 20 ///.<remarks>..........///.This.
4800 6d 65 74 68 6f 64 20 69 73 20 65 71 75 69 76 61 6c 65 6e 74 20 74 6f 20 3c 73 65 65 20 63 72 65 method.is.equivalent.to.<see.cre
4820 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 7b 54 56 61 6c 75 65 7d 2e 57 72 69 74 65 56 61 6c f="InputControl{TValue}.WriteVal
4840 75 65 49 6e 74 6f 53 74 61 74 65 22 2f 3e 20 65 78 63 65 70 74 20 74 68 61 74 20 6f 6e 65 20 64 ueIntoState"/>.except.that.one.d
4860 6f 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 6f 74 20 68 61 76 65 20 74 6f 20 6b 6e 6f oes..........///.not.have.to.kno
4880 77 20 74 68 65 20 76 61 6c 75 65 20 74 79 70 65 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 63 6f w.the.value.type.of.the.given.co
48a0 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a ntrol...........///.</remarks>..
48c0 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 4e 6f 74 ........///.<exception.cref="Not
48e0 53 75 70 70 6f 72 74 65 64 45 78 63 65 70 74 69 6f 6e 22 3e 54 68 65 20 63 6f 6e 74 72 6f 6c 20 SupportedException">The.control.
4900 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 77 72 69 74 69 6e 67 2e 20 54 68 69 73 20 69 does.not.support.writing..This.i
4920 73 20 74 68 65 20 63 61 73 65 2c 20 66 6f 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 65 78 61 s.the.case,.for..........///.exa
4940 6d 70 6c 65 2c 20 74 68 61 74 20 63 6f 6d 70 75 74 65 20 76 61 6c 75 65 73 20 28 73 75 63 68 20 mple,.that.compute.values.(such.
4960 61 73 20 74 68 65 20 6d 61 67 6e 69 74 75 64 65 20 6f 66 20 61 20 76 65 63 74 6f 72 29 2e 3c 2f as.the.magnitude.of.a.vector).</
4980 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f exception>..........///.<seealso
49a0 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 7b 54 56 61 6c 75 65 7d 2e 57 72 69 74 .cref="InputControl{TValue}.Writ
49c0 65 56 61 6c 75 65 49 6e 74 6f 53 74 61 74 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c eValueIntoState"/>..........publ
49e0 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 76 6f 69 64 20 57 72 69 74 65 56 61 6c 75 65 ic.static.unsafe.void.WriteValue
4a00 49 6e 74 6f 53 74 61 74 65 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 IntoState(this.InputControl.cont
4a20 72 6f 6c 2c 20 76 6f 69 64 2a 20 73 74 61 74 65 50 74 72 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d rol,.void*.statePtr)..........{.
4a40 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 20 6e 75 6c 6c .............if.(control.==.null
4a60 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 41 72 67 )..................throw.new.Arg
4a80 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 6f 6e 74 72 6f umentNullException(nameof(contro
4aa0 6c 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 61 74 65 50 74 72 20 3d l));..............if.(statePtr.=
4ac0 3d 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 =.null)..................throw.n
4ae0 65 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 ew.ArgumentNullException(nameof(
4b00 73 74 61 74 65 50 74 72 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 76 statePtr));................var.v
4b20 61 6c 75 65 53 69 7a 65 20 3d 20 63 6f 6e 74 72 6f 6c 2e 76 61 6c 75 65 53 69 7a 65 49 6e 42 79 alueSize.=.control.valueSizeInBy
4b40 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 76 61 6c 75 65 50 74 72 20 3d tes;..............var.valuePtr.=
4b60 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 4d 61 6c 6c 6f 63 28 76 61 6c 75 65 53 69 7a 65 2c .UnsafeUtility.Malloc(valueSize,
4b80 20 38 2c 20 41 6c 6c 6f 63 61 74 6f 72 2e 54 65 6d 70 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 .8,.Allocator.Temp);............
4ba0 20 20 74 72 79 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 ..try..............{............
4bc0 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 52 65 61 64 56 61 6c 75 65 46 72 6f 6d 53 74 61 74 65 ......control.ReadValueFromState
4be0 49 6e 74 6f 42 75 66 66 65 72 28 63 6f 6e 74 72 6f 6c 2e 63 75 72 72 65 6e 74 53 74 61 74 65 50 IntoBuffer(control.currentStateP
4c00 74 72 2c 20 76 61 6c 75 65 50 74 72 2c 20 76 61 6c 75 65 53 69 7a 65 29 3b 0d 0a 20 20 20 20 20 tr,.valuePtr,.valueSize);.......
4c20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 57 72 69 74 65 56 61 6c 75 65 46 72 6f ...........control.WriteValueFro
4c40 6d 42 75 66 66 65 72 49 6e 74 6f 53 74 61 74 65 28 76 61 6c 75 65 50 74 72 2c 20 76 61 6c 75 65 mBufferIntoState(valuePtr,.value
4c60 53 69 7a 65 2c 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 7d 0d Size,.statePtr);..............}.
4c80 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 69 6e 61 6c 6c 79 0d 0a 20 20 20 20 20 20 20 20 20 20 .............finally............
4ca0 20 20 7b 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 ..{..................UnsafeUtili
4cc0 74 79 2e 46 72 65 65 28 76 61 6c 75 65 50 74 72 2c 20 41 6c 6c 6f 63 61 74 6f 72 2e 54 65 6d 70 ty.Free(valuePtr,.Allocator.Temp
4ce0 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 7d 0d 0a 0d 0a );..............}..........}....
4d00 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 76 6f 69 ........public.static.unsafe.voi
4d20 64 20 57 72 69 74 65 56 61 6c 75 65 49 6e 74 6f 53 74 61 74 65 3c 54 56 61 6c 75 65 3e 28 74 68 d.WriteValueIntoState<TValue>(th
4d40 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 54 56 61 6c 75 65 20 is.InputControl.control,.TValue.
4d60 76 61 6c 75 65 2c 20 76 6f 69 64 2a 20 73 74 61 74 65 50 74 72 29 0d 0a 20 20 20 20 20 20 20 20 value,.void*.statePtr)..........
4d80 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 20 20 20 ....where.TValue.:.struct.......
4da0 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.==
4dc0 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
4de0 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
4e00 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 69 66 20 28 21 28 63 ontrol));................if.(!(c
4e20 6f 6e 74 72 6f 6c 20 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3c 54 56 61 6c 75 65 3e 20 63 ontrol.is.InputControl<TValue>.c
4e40 6f 6e 74 72 6f 6c 4f 66 54 79 70 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ontrolOfType))..................
4e60 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 28 0d 0a 20 20 throw.new.ArgumentException(....
4e80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 45 78 70 65 63 74 69 6e 67 20 63 6f ..................$"Expecting.co
4ea0 6e 74 72 6f 6c 20 6f 66 20 74 79 70 65 20 27 7b 74 79 70 65 6f 66 28 54 56 61 6c 75 65 29 2e 4e ntrol.of.type.'{typeof(TValue).N
4ec0 61 6d 65 7d 27 20 62 75 74 20 67 6f 74 20 27 7b 63 6f 6e 74 72 6f 6c 2e 47 65 74 54 79 70 65 28 ame}'.but.got.'{control.GetType(
4ee0 29 2e 4e 61 6d 65 7d 27 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 ).Name}'");................contr
4f00 6f 6c 4f 66 54 79 70 65 2e 57 72 69 74 65 56 61 6c 75 65 49 6e 74 6f 53 74 61 74 65 28 76 61 6c olOfType.WriteValueIntoState(val
4f20 75 65 2c 20 73 74 61 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 ue,.statePtr);..........}.......
4f40 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 76 6f 69 64 20 57 .....public.static.unsafe.void.W
4f60 72 69 74 65 56 61 6c 75 65 49 6e 74 6f 53 74 61 74 65 3c 54 56 61 6c 75 65 3e 28 74 68 69 73 20 riteValueIntoState<TValue>(this.
4f80 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 6c 2c 20 54 56 InputControl<TValue>.control,.TV
4fa0 61 6c 75 65 20 76 61 6c 75 65 2c 20 76 6f 69 64 2a 20 73 74 61 74 65 50 74 72 29 0d 0a 20 20 20 alue.value,.void*.statePtr).....
4fc0 20 20 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 .........where.TValue.:.struct..
4fe0 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 20 28 63 6f 6e 74 72 ........{..............if.(contr
5000 6f 6c 20 3d 3d 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 ol.==.null)..................thr
5020 6f 77 20 6e 65 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 ow.new.ArgumentNullException(nam
5040 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 20 69 66 20 28 eof(control));..............if.(
5060 73 74 61 74 65 50 74 72 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 statePtr.==.null)...............
5080 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 ...throw.new.ArgumentNullExcepti
50a0 6f 6e 28 6e 61 6d 65 6f 66 28 73 74 61 74 65 50 74 72 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 on(nameof(statePtr));...........
50c0 20 20 20 20 20 76 61 72 20 76 61 6c 75 65 50 74 72 20 3d 20 55 6e 73 61 66 65 55 74 69 6c 69 74 .....var.valuePtr.=.UnsafeUtilit
50e0 79 2e 41 64 64 72 65 73 73 4f 66 28 72 65 66 20 76 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 y.AddressOf(ref.value);.........
5100 20 20 20 20 20 76 61 72 20 76 61 6c 75 65 53 69 7a 65 20 3d 20 55 6e 73 61 66 65 55 74 69 6c 69 .....var.valueSize.=.UnsafeUtili
5120 74 79 2e 53 69 7a 65 4f 66 3c 54 56 61 6c 75 65 3e 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ty.SizeOf<TValue>();............
5140 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 57 72 69 74 65 56 61 6c 75 65 46 72 6f 6d 42 75 66 66 65 72 ....control.WriteValueFromBuffer
5160 49 6e 74 6f 53 74 61 74 65 28 76 61 6c 75 65 50 74 72 2c 20 76 61 6c 75 65 53 69 7a 65 2c 20 73 IntoState(valuePtr,.valueSize,.s
5180 74 61 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 tatePtr);..........}............
51a0 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 76 6f 69 64 20 57 72 69 74 65 56 public.static.unsafe.void.WriteV
51c0 61 6c 75 65 49 6e 74 6f 53 74 61 74 65 3c 54 56 61 6c 75 65 3e 28 74 68 69 73 20 49 6e 70 75 74 alueIntoState<TValue>(this.Input
51e0 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 76 6f 69 64 2a 20 73 Control<TValue>.control,.void*.s
5200 74 61 74 65 50 74 72 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 tatePtr)..............where.TVal
5220 75 65 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 ue.:.struct..........{..........
5240 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 ....if.(control.==.null)........
5260 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 4e 75 6c 6c ..........throw.new.ArgumentNull
5280 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 0d 0a 20 Exception(nameof(control));.....
52a0 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 57 72 69 74 65 56 61 6c 75 65 49 6e 74 ...........control.WriteValueInt
52c0 6f 53 74 61 74 65 28 63 6f 6e 74 72 6f 6c 2e 52 65 61 64 56 61 6c 75 65 28 29 2c 20 73 74 61 74 oState(control.ReadValue(),.stat
52e0 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 2f 2f 2f ePtr);..........}............///
5300 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 .<summary>..........///.........
5320 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 20 3c 70 61 .///.</summary>..........///.<pa
5340 72 61 6d 20 6e 61 6d 65 3d 22 73 74 61 74 65 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 ram.name="state"></param>.......
5360 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 76 61 6c 75 65 22 3e 56 61 6c 75 65 ...///.<param.name="value">Value
5380 20 66 6f 72 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 .for.<paramref.name="control"/>.
53a0 74 6f 20 77 72 69 74 65 20 69 6e 74 6f 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 to.write.into.<paramref.name="st
53c0 61 74 65 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 74 79 ate"/>.</param>..........///.<ty
53e0 70 65 70 61 72 61 6d 20 6e 61 6d 65 3d 22 54 53 74 61 74 65 22 3e 3c 2f 74 79 70 65 70 61 72 61 peparam.name="TState"></typepara
5400 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d m>..........///.<exception.cref=
5420 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 "ArgumentNullException"><paramre
5440 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 69 73 20 6e 75 6c 6c 2e 3c 2f 65 78 63 f.name="control"/>.is.null.</exc
5460 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 eption>..........///.<exception.
5480 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 22 3e 43 6f 6e 74 72 6f 6c cref="ArgumentException">Control
54a0 27 73 20 76 61 6c 75 65 20 64 6f 65 73 20 6e 6f 74 20 66 69 74 20 77 69 74 68 69 6e 20 74 68 65 's.value.does.not.fit.within.the
54c0 20 6d 65 6d 6f 72 79 20 6f 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 61 74 65 .memory.of.<paramref.name="state
54e0 22 2f 3e 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 2f 20 3c 65 "/>.</exception>..........///.<e
5500 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 4e 6f 74 53 75 70 70 6f 72 74 65 64 45 78 63 65 70 xception.cref="NotSupportedExcep
5520 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e tion"><paramref.name="control"/>
5540 20 64 6f 65 73 20 6e 6f 74 20 73 75 70 70 6f 72 74 20 77 72 69 74 69 6e 67 2e 3c 2f 65 78 63 65 .does.not.support.writing.</exce
5560 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e ption>..........public.static.un
5580 73 61 66 65 20 76 6f 69 64 20 57 72 69 74 65 56 61 6c 75 65 49 6e 74 6f 53 74 61 74 65 3c 54 56 safe.void.WriteValueIntoState<TV
55a0 61 6c 75 65 2c 20 54 53 74 61 74 65 3e 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3c alue,.TState>(this.InputControl<
55c0 54 56 61 6c 75 65 3e 20 63 6f 6e 74 72 6f 6c 2c 20 54 56 61 6c 75 65 20 76 61 6c 75 65 2c 20 72 TValue>.control,.TValue.value,.r
55e0 65 66 20 54 53 74 61 74 65 20 73 74 61 74 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 ef.TState.state)..............wh
5600 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 20 20 20 20 20 20 20 ere.TValue.:.struct.............
5620 20 77 68 65 72 65 20 54 53 74 61 74 65 20 3a 20 73 74 72 75 63 74 2c 20 49 49 6e 70 75 74 53 74 .where.TState.:.struct,.IInputSt
5640 61 74 65 54 79 70 65 49 6e 66 6f 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 ateTypeInfo..........{..........
5660 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 ....if.(control.==.null)........
5680 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 4e 75 6c 6c ..........throw.new.ArgumentNull
56a0 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 0d 0a 20 Exception(nameof(control));.....
56c0 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 65 20 63 6f 6e 74 ...........//.Make.sure.the.cont
56e0 72 6f 6c 27 73 20 73 74 61 74 65 20 61 63 74 75 61 6c 6c 79 20 66 69 74 73 20 77 69 74 68 69 6e rol's.state.actually.fits.within
5700 20 74 68 65 20 67 69 76 65 6e 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 .the.given.state...............v
5720 61 72 20 73 69 7a 65 4f 66 53 74 61 74 65 20 3d 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 53 ar.sizeOfState.=.UnsafeUtility.S
5740 69 7a 65 4f 66 3c 54 53 74 61 74 65 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 izeOf<TState>();..............if
5760 20 28 63 6f 6e 74 72 6f 6c 2e 73 74 61 74 65 4f 66 66 73 65 74 52 65 6c 61 74 69 76 65 54 6f 44 .(control.stateOffsetRelativeToD
5780 65 76 69 63 65 52 6f 6f 74 20 2b 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b eviceRoot.+.control.m_StateBlock
57a0 2e 61 6c 69 67 6e 65 64 53 69 7a 65 49 6e 42 79 74 65 73 20 3e 3d 20 73 69 7a 65 4f 66 53 74 61 .alignedSizeInBytes.>=.sizeOfSta
57c0 74 65 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 41 te)..................throw.new.A
57e0 72 67 75 6d 65 6e 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 rgumentException(...............
5800 20 20 20 20 20 20 20 24 22 43 6f 6e 74 72 6f 6c 20 7b 63 6f 6e 74 72 6f 6c 2e 70 61 74 68 7d 20 .......$"Control.{control.path}.
5820 77 69 74 68 20 6f 66 66 73 65 74 20 7b 63 6f 6e 74 72 6f 6c 2e 73 74 61 74 65 4f 66 66 73 65 74 with.offset.{control.stateOffset
5840 52 65 6c 61 74 69 76 65 54 6f 44 65 76 69 63 65 52 6f 6f 74 7d 20 61 6e 64 20 73 69 7a 65 20 6f RelativeToDeviceRoot}.and.size.o
5860 66 20 7b 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 f.{control.m_StateBlock.sizeInBi
5880 74 73 7d 20 62 69 74 73 20 69 73 20 6f 75 74 20 6f 66 20 62 6f 75 6e 64 73 20 66 6f 72 20 73 74 ts}.bits.is.out.of.bounds.for.st
58a0 61 74 65 20 6f 66 20 74 79 70 65 20 7b 74 79 70 65 6f 66 28 54 53 74 61 74 65 29 2e 4e 61 6d 65 ate.of.type.{typeof(TState).Name
58c0 7d 20 77 69 74 68 20 73 69 7a 65 20 7b 73 69 7a 65 4f 66 53 74 61 74 65 7d 22 2c 0d 0a 20 20 20 }.with.size.{sizeOfState}",.....
58e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 6f 66 28 73 74 61 74 65 29 29 3b .................nameof(state));
5900 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 72 69 74 65 20 76 61 6c 75 65 2e 0d ................//.Write.value..
5920 0a 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 74 .............var.statePtr.=.(byt
5940 65 2a 29 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 41 64 64 72 65 73 73 4f 66 28 72 65 66 20 73 e*)UnsafeUtility.AddressOf(ref.s
5960 74 61 74 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 57 72 69 74 tate);..............control.Writ
5980 65 56 61 6c 75 65 49 6e 74 6f 53 74 61 74 65 28 76 61 6c 75 65 2c 20 73 74 61 74 65 50 74 72 29 eValueIntoState(value,.statePtr)
59a0 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 63 20 73 ;..........}............public.s
59c0 74 61 74 69 63 20 76 6f 69 64 20 57 72 69 74 65 56 61 6c 75 65 49 6e 74 6f 45 76 65 6e 74 3c 54 tatic.void.WriteValueIntoEvent<T
59e0 56 61 6c 75 65 3e 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c Value>(this.InputControl.control
5a00 2c 20 54 56 61 6c 75 65 20 76 61 6c 75 65 2c 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 20 65 76 ,.TValue.value,.InputEventPtr.ev
5a20 65 6e 74 50 74 72 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 entPtr)..............where.TValu
5a40 65 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 e.:.struct..........{...........
5a60 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 ...if.(control.==.null).........
5a80 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 4e 75 6c 6c 45 .........throw.new.ArgumentNullE
5aa0 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 20 20 20 20 xception(nameof(control));......
5ac0 20 20 20 20 20 20 20 20 69 66 20 28 21 65 76 65 6e 74 50 74 72 2e 76 61 6c 69 64 29 0d 0a 20 20 ........if.(!eventPtr.valid)....
5ae0 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
5b00 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 65 76 65 6e 74 50 74 72 29 29 3b NullException(nameof(eventPtr));
5b20 0d 0a 0d 0a 20 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 ................if.(!(control.is
5b40 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 6c 4f 66 54 .InputControl<TValue>.controlOfT
5b60 79 70 65 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 ype))..................throw.new
5b80 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .ArgumentException(.............
5ba0 20 20 20 20 20 20 20 20 20 24 22 45 78 70 65 63 74 69 6e 67 20 63 6f 6e 74 72 6f 6c 20 6f 66 20 .........$"Expecting.control.of.
5bc0 74 79 70 65 20 27 7b 74 79 70 65 6f 66 28 54 56 61 6c 75 65 29 2e 4e 61 6d 65 7d 27 20 62 75 74 type.'{typeof(TValue).Name}'.but
5be0 20 67 6f 74 20 27 7b 63 6f 6e 74 72 6f 6c 2e 47 65 74 54 79 70 65 28 29 2e 4e 61 6d 65 7d 27 22 .got.'{control.GetType().Name}'"
5c00 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 4f 66 54 79 70 65 2e );................controlOfType.
5c20 57 72 69 74 65 56 61 6c 75 65 49 6e 74 6f 45 76 65 6e 74 28 76 61 6c 75 65 2c 20 65 76 65 6e 74 WriteValueIntoEvent(value,.event
5c40 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 75 62 6c Ptr);..........}............publ
5c60 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 76 6f 69 64 20 57 72 69 74 65 56 61 6c 75 65 ic.static.unsafe.void.WriteValue
5c80 49 6e 74 6f 45 76 65 6e 74 3c 54 56 61 6c 75 65 3e 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 IntoEvent<TValue>(this.InputCont
5ca0 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 75 65 20 76 61 6c 75 rol<TValue>.control,.TValue.valu
5cc0 65 2c 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 20 65 76 65 6e 74 50 74 72 29 0d 0a 20 20 20 20 e,.InputEventPtr.eventPtr)......
5ce0 20 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 ........where.TValue.:.struct...
5d00 20 20 20 20 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 .......{..............if.(contro
5d20 6c 20 3d 3d 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 l.==.null)..................thro
5d40 77 20 6e 65 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 w.new.ArgumentNullException(name
5d60 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 20 69 66 20 28 21 of(control));..............if.(!
5d80 65 76 65 6e 74 50 74 72 2e 76 61 6c 69 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eventPtr.valid).................
5da0 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e .throw.new.ArgumentNullException
5dc0 28 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 20 20 20 20 20 20 (nameof(eventPtr));.............
5de0 20 20 20 76 61 72 20 73 74 61 74 65 50 74 72 20 3d 20 63 6f 6e 74 72 6f 6c 2e 47 65 74 53 74 61 ...var.statePtr.=.control.GetSta
5e00 74 65 50 74 72 46 72 6f 6d 53 74 61 74 65 45 76 65 6e 74 28 65 76 65 6e 74 50 74 72 29 3b 0d 0a tePtrFromStateEvent(eventPtr);..
5e20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 61 74 65 50 74 72 20 3d 3d 20 6e 75 6c 6c ............if.(statePtr.==.null
5e40 29 0d 0a 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 0d 0a 20 20 )..................return;......
5e60 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 57 72 69 74 65 56 61 6c 75 65 49 6e 74 6f ..........control.WriteValueInto
5e80 53 74 61 74 65 28 76 61 6c 75 65 2c 20 73 74 61 74 65 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 State(value,.statePtr);.........
5ea0 20 7d 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 .}............///.<summary>.....
5ec0 20 20 20 20 20 2f 2f 2f 20 43 6f 70 79 20 74 68 65 20 73 74 61 74 65 20 6f 66 20 74 68 65 20 64 .....///.Copy.the.state.of.the.d
5ee0 65 76 69 63 65 20 74 6f 20 74 68 65 20 67 69 76 65 6e 20 6d 65 6d 6f 72 79 20 62 75 66 66 65 72 evice.to.the.given.memory.buffer
5f00 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 0a 20 20 20 20 20 ...........///.</summary>.......
5f20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 41 6e 20 69 ...///.<param.name="device">An.i
5f40 6e 70 75 74 20 64 65 76 69 63 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f nput.device.</param>..........//
5f60 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 62 75 66 66 65 72 22 3e 42 75 66 66 65 72 20 74 6f /.<param.name="buffer">Buffer.to
5f80 20 63 6f 70 79 20 74 68 65 20 73 74 61 74 65 20 6f 66 20 74 68 65 20 64 65 76 69 63 65 20 74 6f .copy.the.state.of.the.device.to
5fa0 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 .</param>..........///.<param.na
5fc0 6d 65 3d 22 62 75 66 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 22 3e 53 69 7a 65 20 6f 66 20 3c me="bufferSizeInBytes">Size.of.<
5fe0 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 62 75 66 66 65 72 22 2f 3e 20 69 6e 20 62 79 74 65 paramref.name="buffer"/>.in.byte
6000 73 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 s.</param>..........///.<excepti
6020 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 6e 22 3e 3c 70 61 72 on.cref="ArgumentException"><par
6040 61 6d 72 65 66 20 6e 61 6d 65 3d 22 62 75 66 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 22 2f 3e amref.name="bufferSizeInBytes"/>
6060 20 69 73 20 6c 65 73 73 20 74 68 61 6e 20 6f 72 20 65 71 75 61 6c 20 74 6f 20 30 2e 3c 2f 65 78 .is.less.than.or.equal.to.0.</ex
6080 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e ception>..........///.<exception
60a0 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 .cref="ArgumentNullException"><p
60c0 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 aramref.name="device"/>.is.<c>nu
60e0 6c 6c 3c 2f 63 3e 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 2f ll</c>.</exception>..........///
6100 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 6d 65 74 68 .<remarks>..........///.The.meth
6120 6f 64 20 77 69 6c 6c 20 63 6f 70 79 20 68 6f 77 65 76 65 72 20 6d 75 63 68 20 66 69 74 73 20 69 od.will.copy.however.much.fits.i
6140 6e 74 6f 20 74 68 65 20 67 69 76 65 6e 20 62 75 66 66 65 72 2e 20 54 68 69 73 20 6d 65 61 6e 73 nto.the.given.buffer..This.means
6160 20 74 68 61 74 20 69 66 20 74 68 65 20 73 74 61 74 65 20 6f 66 20 74 68 65 20 64 65 76 69 63 65 .that.if.the.state.of.the.device
6180 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 6c 61 72 67 65 72 20 74 68 61 6e 20 77 68 61 ..........///.is.larger.than.wha
61a0 74 20 66 69 74 73 20 69 6e 74 6f 20 74 68 65 20 62 75 66 66 65 72 2c 20 6e 6f 74 20 61 6c 6c 20 t.fits.into.the.buffer,.not.all.
61c0 6f 66 20 74 68 65 20 64 65 76 69 63 65 27 73 20 73 74 61 74 65 20 69 73 20 63 6f 70 69 65 64 2e of.the.device's.state.is.copied.
61e0 0d 0a 20 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 ..........///.</remarks>........
6200 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f ..///.<seealso.cref="InputContro
6220 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 l.stateBlock"/>..........public.
6240 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 76 6f 69 64 20 43 6f 70 79 53 74 61 74 65 28 74 68 69 static.unsafe.void.CopyState(thi
6260 73 20 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 76 6f 69 64 2a 20 62 75 66 66 s.InputDevice.device,.void*.buff
6280 65 72 2c 20 69 6e 74 20 62 75 66 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 29 0d 0a 20 20 20 20 er,.int.bufferSizeInBytes)......
62a0 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 65 20 3d 3d ....{..............if.(device.==
62c0 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
62e0 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 64 w.ArgumentNullException(nameof(d
6300 65 76 69 63 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 62 75 66 66 65 72 evice));..............if.(buffer
6320 53 69 7a 65 49 6e 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 SizeInBytes.<=.0)...............
6340 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 28 22 ...throw.new.ArgumentException("
6360 62 75 66 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 20 6d 75 73 74 20 62 65 20 70 6f 73 69 74 69 bufferSizeInBytes.must.be.positi
6380 76 65 22 2c 20 6e 61 6d 65 6f 66 28 62 75 66 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 29 29 3b ve",.nameof(bufferSizeInBytes));
63a0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 74 65 42 6c 6f 63 6b 20 3d ................var.stateBlock.=
63c0 20 64 65 76 69 63 65 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 .device.m_StateBlock;...........
63e0 20 20 20 76 61 72 20 73 69 7a 65 54 6f 43 6f 70 79 20 3d 20 4d 61 74 68 2e 4d 69 6e 28 62 75 66 ...var.sizeToCopy.=.Math.Min(buf
6400 66 65 72 53 69 7a 65 49 6e 42 79 74 65 73 2c 20 73 74 61 74 65 42 6c 6f 63 6b 2e 61 6c 69 67 6e ferSizeInBytes,.stateBlock.align
6420 65 64 53 69 7a 65 49 6e 42 79 74 65 73 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 55 edSizeInBytes);................U
6440 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 4d 65 6d 43 70 79 28 62 75 66 66 65 72 2c 20 28 62 79 74 nsafeUtility.MemCpy(buffer,.(byt
6460 65 2a 29 64 65 76 69 63 65 2e 63 75 72 72 65 6e 74 53 74 61 74 65 50 74 72 20 2b 20 73 74 61 74 e*)device.currentStatePtr.+.stat
6480 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 2c 20 73 69 7a 65 54 6f 43 6f 70 79 29 3b 0d eBlock.byteOffset,.sizeToCopy);.
64a0 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 .........}............///.<summa
64c0 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 6f 70 79 20 74 68 65 20 73 74 61 74 65 20 ry>..........///.Copy.the.state.
64e0 6f 66 20 74 68 65 20 64 65 76 69 63 65 20 74 6f 20 74 68 65 20 67 69 76 65 6e 20 73 74 72 75 63 of.the.device.to.the.given.struc
6500 74 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 0a 20 20 20 20 t...........///.</summary>......
6520 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 41 6e 20 ....///.<param.name="device">An.
6540 69 6e 70 75 74 20 64 65 76 69 63 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f input.device.</param>........../
6560 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 73 74 61 74 65 22 3e 53 74 72 75 63 74 20 74 6f //.<param.name="state">Struct.to
6580 20 63 6f 70 79 20 74 68 65 20 73 74 61 74 65 20 6f 66 20 74 68 65 20 64 65 76 69 63 65 20 69 6e .copy.the.state.of.the.device.in
65a0 74 6f 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 74 79 70 65 70 61 to.</param>..........///.<typepa
65c0 72 61 6d 20 6e 61 6d 65 3d 22 54 53 74 61 74 65 22 3e 41 20 73 74 61 74 65 20 73 74 72 75 63 74 ram.name="TState">A.state.struct
65e0 20 74 79 70 65 20 73 75 63 68 20 61 73 20 3c 73 65 65 20 63 72 65 66 3d 22 4d 6f 75 73 65 53 74 .type.such.as.<see.cref="MouseSt
6600 61 74 65 22 2f 3e 2e 3c 2f 74 79 70 65 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ate"/>.</typeparam>..........///
6620 20 3c 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 .<exception.cref="ArgumentExcept
6640 69 6f 6e 22 3e 54 68 65 20 73 74 61 74 65 20 66 6f 72 6d 61 74 20 6f 66 20 3c 74 79 70 65 70 61 ion">The.state.format.of.<typepa
6660 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 54 53 74 61 74 65 22 2f 3e 20 64 6f 65 73 20 6e 6f 74 20 ramref.name="TState"/>.does.not.
6680 6d 61 74 63 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 73 74 61 74 65 20 66 6f 72 match..........///.the.state.for
66a0 6d 20 6f 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 2e 3c m.of.<paramref.name="device"/>.<
66c0 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 /exception>..........///.<except
66e0 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 ion.cref="ArgumentNullException"
6700 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 73 20 3c 63 ><paramref.name="device"/>.is.<c
6720 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 >null</c>.</exception>..........
6740 2f 2f 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 54 68 69 73 20 ///.<remarks>..........///.This.
6760 6d 65 74 68 6f 64 20 77 69 6c 6c 20 63 6f 70 79 20 6d 65 6d 6f 72 79 20 76 65 72 62 61 74 69 6d method.will.copy.memory.verbatim
6780 20 69 6e 74 6f 20 74 68 65 20 6d 65 6d 6f 72 79 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 73 74 .into.the.memory.of.the.given.st
67a0 72 75 63 74 2e 20 49 74 20 77 69 6c 6c 20 63 6f 70 79 20 77 68 61 74 65 76 65 72 0d 0a 20 20 20 ruct..It.will.copy.whatever.....
67c0 20 20 20 20 20 2f 2f 2f 20 6d 65 6d 6f 72 79 20 6f 66 20 74 68 65 20 64 65 76 69 63 65 20 66 69 .....///.memory.of.the.device.fi
67e0 74 73 20 69 6e 74 6f 20 74 68 65 20 67 69 76 65 6e 20 73 74 72 75 63 74 2e 0d 0a 20 20 20 20 20 ts.into.the.given.struct........
6800 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 2f 20 3c ...///.</remarks>..........///.<
6820 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 73 74 61 74 65 seealso.cref="InputControl.state
6840 42 6c 6f 63 6b 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 Block"/>..........public.static.
6860 75 6e 73 61 66 65 20 76 6f 69 64 20 43 6f 70 79 53 74 61 74 65 3c 54 53 74 61 74 65 3e 28 74 68 unsafe.void.CopyState<TState>(th
6880 69 73 20 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 6f 75 74 20 54 53 74 61 74 is.InputDevice.device,.out.TStat
68a0 65 20 73 74 61 74 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 54 53 74 61 e.state)..............where.TSta
68c0 74 65 20 3a 20 73 74 72 75 63 74 2c 20 49 49 6e 70 75 74 53 74 61 74 65 54 79 70 65 49 6e 66 6f te.:.struct,.IInputStateTypeInfo
68e0 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 20 28 64 65 76 ..........{..............if.(dev
6900 69 63 65 20 3d 3d 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 ice.==.null)..................th
6920 72 6f 77 20 6e 65 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 row.new.ArgumentNullException(na
6940 6d 65 6f 66 28 64 65 76 69 63 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 74 meof(device));................st
6960 61 74 65 20 3d 20 64 65 66 61 75 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 ate.=.default;..............if.(
6980 64 65 76 69 63 65 2e 73 74 61 74 65 42 6c 6f 63 6b 2e 66 6f 72 6d 61 74 20 21 3d 20 73 74 61 74 device.stateBlock.format.!=.stat
69a0 65 2e 66 6f 72 6d 61 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 e.format)..................throw
69c0 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 .new.ArgumentException(.........
69e0 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 53 74 72 75 63 74 20 27 7b 74 79 70 65 6f 66 28 54 .............$"Struct.'{typeof(T
6a00 53 74 61 74 65 29 2e 4e 61 6d 65 7d 27 20 68 61 73 20 73 74 61 74 65 20 66 6f 72 6d 61 74 20 27 State).Name}'.has.state.format.'
6a20 7b 73 74 61 74 65 2e 66 6f 72 6d 61 74 7d 27 20 77 68 69 63 68 20 64 6f 65 73 6e 27 74 20 6d 61 {state.format}'.which.doesn't.ma
6a40 74 63 68 20 64 65 76 69 63 65 20 27 7b 64 65 76 69 63 65 7d 27 20 77 69 74 68 20 73 74 61 74 65 tch.device.'{device}'.with.state
6a60 20 66 6f 72 6d 61 74 20 27 7b 64 65 76 69 63 65 2e 73 74 61 74 65 42 6c 6f 63 6b 2e 66 6f 72 6d .format.'{device.stateBlock.form
6a80 61 74 7d 27 22 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 at}'",......................name
6aa0 6f 66 28 54 53 74 61 74 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 of(TState));................var.
6ac0 73 74 61 74 65 53 69 7a 65 20 3d 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 53 69 7a 65 4f 66 stateSize.=.UnsafeUtility.SizeOf
6ae0 3c 54 53 74 61 74 65 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 <TState>();..............var.sta
6b00 74 65 50 74 72 20 3d 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 41 64 64 72 65 73 73 4f 66 28 tePtr.=.UnsafeUtility.AddressOf(
6b20 72 65 66 20 73 74 61 74 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 64 65 76 69 63 ref.state);................devic
6b40 65 2e 43 6f 70 79 53 74 61 74 65 28 73 74 61 74 65 50 74 72 2c 20 73 74 61 74 65 53 69 7a 65 29 e.CopyState(statePtr,.stateSize)
6b60 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d ;..........}............///.<sum
6b80 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 68 65 63 6b 20 77 68 65 74 68 65 72 mary>..........///.Check.whether
6ba0 20 74 68 65 20 6d 65 6d 6f 72 79 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 63 6f 6e 74 72 6f 6c .the.memory.of.the.given.control
6bc0 20 69 73 20 69 6e 20 69 74 73 20 64 65 66 61 75 6c 74 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 .is.in.its.default.state........
6be0 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 20 3c ...///.</summary>..........///.<
6c00 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 3e 41 6e 20 69 6e 70 75 74 20 63 6f param.name="control">An.input.co
6c20 6e 74 72 6f 6c 20 6f 6e 20 61 20 64 65 76 69 63 65 20 74 68 61 74 27 73 20 62 65 65 6e 20 61 64 ntrol.on.a.device.that's.been.ad
6c40 64 65 64 20 74 6f 20 74 68 65 20 73 79 73 74 65 6d 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 ded.to.the.system.(see.<see.cref
6c60 3d 22 49 6e 70 75 74 44 65 76 69 63 65 2e 61 64 64 65 64 22 2f 3e 29 2e 3c 2f 70 61 72 61 6d 3e ="InputDevice.added"/>).</param>
6c80 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 72 75 65 20 69 66 20 74 ..........///.<returns>True.if.t
6ca0 68 65 20 73 74 61 74 65 20 6d 65 6d 6f 72 79 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 63 6f 6e he.state.memory.of.the.given.con
6cc0 74 72 6f 6c 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 74 68 65 20 63 6f 6e 74 72 6f 6c 27 trol.corresponds.to.the.control'
6ce0 73 20 64 65 66 61 75 6c 74 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f s.default.</returns>..........//
6d00 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 /.<exception.cref="ArgumentNullE
6d20 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f xception"><paramref.name="contro
6d40 6c 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e l"/>.is.<c>null</c>.</exception>
6d60 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>.........
6d80 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 69 73 20 61 20 63 68 65 61 70 65 72 20 63 68 .///.This.method.is.a.cheaper.ch
6da0 65 63 6b 20 74 68 61 6e 20 61 63 74 75 61 6c 6c 79 20 72 65 61 64 69 6e 67 20 6f 75 74 20 74 68 eck.than.actually.reading.out.th
6dc0 65 20 76 61 6c 75 65 20 66 72 6f 6d 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 61 6e 64 20 63 68 65 e.value.from.the.control.and.che
6de0 63 6b 69 6e 67 20 77 68 65 74 68 65 72 20 69 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 cking.whether.it..........///.is
6e00 20 74 68 65 20 73 61 6d 65 20 76 61 6c 75 65 20 61 73 20 74 68 65 20 64 65 66 61 75 6c 74 20 76 .the.same.value.as.the.default.v
6e20 61 6c 75 65 2e 20 54 68 65 20 6d 65 74 68 6f 64 20 62 79 70 61 73 73 65 73 20 61 6c 6c 20 76 61 alue..The.method.bypasses.all.va
6e40 6c 75 65 20 72 65 61 64 69 6e 67 20 61 6e 64 20 73 69 6d 70 6c 79 20 70 65 72 66 6f 72 6d 73 20 lue.reading.and.simply.performs.
6e60 61 20 74 72 69 76 69 61 6c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6d 65 6d 6f 72 79 20 63 6f a.trivial..........///.memory.co
6e80 6d 70 61 72 69 73 6f 6e 20 6f 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 27 73 20 63 75 72 72 65 6e mparison.of.the.control's.curren
6ea0 74 20 73 74 61 74 65 20 6d 65 6d 6f 72 79 20 74 6f 20 74 68 65 20 64 65 66 61 75 6c 74 20 73 74 t.state.memory.to.the.default.st
6ec0 61 74 65 20 6d 65 6d 6f 72 79 20 73 74 6f 72 65 64 20 66 6f 72 20 74 68 65 20 63 6f 6e 74 72 6f ate.memory.stored.for.the.contro
6ee0 6c 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 l...........///..........///.Not
6f00 65 20 74 68 61 74 20 74 68 65 20 64 65 66 61 75 6c 74 20 73 74 61 74 65 20 66 6f 72 20 74 68 65 e.that.the.default.state.for.the
6f20 20 6d 65 6d 6f 72 79 20 6f 66 20 61 20 63 6f 6e 74 72 6f 6c 20 64 6f 65 73 20 6e 6f 74 20 6e 65 .memory.of.a.control.does.not.ne
6f40 63 65 73 73 61 72 79 20 6e 65 65 64 20 74 6f 20 62 65 20 61 6c 6c 20 7a 65 72 6f 65 73 2e 20 46 cessary.need.to.be.all.zeroes..F
6f60 6f 72 20 65 78 61 6d 70 6c 65 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 20 73 74 69 63 6b or.example,..........///.a.stick
6f80 20 61 78 69 73 20 6d 61 79 20 62 65 20 73 74 6f 72 65 64 20 61 73 20 61 6e 20 75 6e 73 69 67 6e .axis.may.be.stored.as.an.unsign
6fa0 65 64 20 38 2d 62 69 74 20 76 61 6c 75 65 20 77 69 74 68 20 74 68 65 20 6d 65 6d 6f 72 79 20 73 ed.8-bit.value.with.the.memory.s
6fc0 74 61 74 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 61 20 30 20 76 61 6c 75 65 20 tate.corresponding.to.a.0.value.
6fe0 62 65 69 6e 67 20 31 32 37 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b being.127...........///.</remark
7000 73 3e 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 49 s>..........///.<seealso.cref="I
7020 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 22 2f 3e 0d 0a 20 20 20 20 20 nputControl.stateBlock"/>.......
7040 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 62 6f 6f 6c 20 43 68 65 ...public.static.unsafe.bool.Che
7060 63 6b 53 74 61 74 65 49 73 41 74 44 65 66 61 75 6c 74 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e ckStateIsAtDefault(this.InputCon
7080 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 trol.control)..........{........
70a0 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 ......if.(control.==.null)......
70c0 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 4e 75 ............throw.new.ArgumentNu
70e0 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 0d llException(nameof(control));...
7100 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 43 68 65 63 6b 53 74 61 74 65 49 73 .............return.CheckStateIs
7120 41 74 44 65 66 61 75 6c 74 28 63 6f 6e 74 72 6f 6c 2c 20 63 6f 6e 74 72 6f 6c 2e 63 75 72 72 65 AtDefault(control,.control.curre
7140 6e 74 53 74 61 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 ntStatePtr);..........}.........
7160 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 43 68 ...///.<summary>..........///.Ch
7180 65 63 6b 20 69 66 20 74 68 65 20 67 69 76 65 6e 20 73 74 61 74 65 20 63 6f 72 72 65 73 70 6f 6e eck.if.the.given.state.correspon
71a0 64 73 20 74 6f 20 74 68 65 20 64 65 66 61 75 6c 74 20 73 74 61 74 65 20 6f 66 20 74 68 65 20 63 ds.to.the.default.state.of.the.c
71c0 6f 6e 74 72 6f 6c 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 ontrol...........///.</summary>.
71e0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f .........///.<param.name="contro
7200 6c 22 3e 43 6f 6e 74 72 6f 6c 20 74 6f 20 63 68 65 63 6b 20 74 68 65 20 73 74 61 74 65 20 66 6f l">Control.to.check.the.state.fo
7220 72 20 69 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 61 74 65 50 74 72 22 2f 3e r.in.<paramref.name="statePtr"/>
7240 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 .</param>..........///.<param.na
7260 6d 65 3d 22 73 74 61 74 65 50 74 72 22 3e 50 6f 69 6e 74 65 72 20 74 6f 20 61 20 73 74 61 74 65 me="statePtr">Pointer.to.a.state
7280 20 62 75 66 66 65 72 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 3c 73 65 65 20 63 72 65 66 .buffer.containing.the.<see.cref
72a0 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 22 2f 3e 20 66 6f 72 ="InputControl.stateBlock"/>.for
72c0 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 2e 3c 2f 70 61 .<paramref.name="control"/>.</pa
72e0 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6d ram>..........///.<param.name="m
7300 61 73 6b 50 74 72 22 3e 49 66 20 6e 6f 74 20 6e 75 6c 6c 2c 20 6f 6e 6c 79 20 62 69 74 73 20 73 askPtr">If.not.null,.only.bits.s
7320 65 74 20 74 6f 20 3c 63 3e 66 61 6c 73 65 3c 2f 63 3e 20 28 21 29 20 69 6e 20 74 68 65 20 62 75 et.to.<c>false</c>.(!).in.the.bu
7340 66 66 65 72 20 77 69 6c 6c 20 62 65 20 74 61 6b 65 6e 20 69 6e 74 6f 20 61 63 63 6f 75 6e 74 2e ffer.will.be.taken.into.account.
7360 20 54 68 69 73 20 63 61 6e 20 62 65 20 75 73 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 .This.can.be.used..........///.t
7380 6f 20 6d 61 73 6b 20 6f 75 74 20 6e 6f 69 73 65 2c 20 69 2e 65 2e 20 65 76 65 72 79 20 62 69 74 o.mask.out.noise,.i.e..every.bit
73a0 20 74 68 61 74 20 69 73 20 73 65 74 20 69 6e 20 74 68 65 20 6d 61 73 6b 20 69 73 20 63 6f 6e 73 .that.is.set.in.the.mask.is.cons
73c0 69 64 65 72 65 64 20 74 6f 20 72 65 70 72 65 73 65 6e 74 20 6e 6f 69 73 65 2e 3c 2f 70 61 72 61 idered.to.represent.noise.</para
73e0 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 72 75 65 20 69 66 m>..........///.<returns>True.if
7400 20 74 68 65 20 63 6f 6e 74 72 6f 6c 2f 64 65 76 69 63 65 20 69 73 20 69 6e 20 69 74 73 20 64 65 .the.control/device.is.in.its.de
7420 66 61 75 6c 74 20 73 74 61 74 65 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 fault.state.</returns>..........
7440 2f 2f 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 4e 6f 74 65 20 ///.<remarks>..........///.Note.
7460 74 68 61 74 20 64 65 66 61 75 6c 74 20 64 6f 65 73 20 6e 6f 74 20 65 71 75 61 74 65 20 61 6c 6c that.default.does.not.equate.all
7480 20 7a 65 72 6f 65 73 2e 20 53 74 69 63 6b 20 61 78 65 73 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 .zeroes..Stick.axes,.for.example
74a0 2c 20 74 68 61 74 20 61 72 65 20 73 74 6f 72 65 64 20 61 73 20 75 6e 73 69 67 6e 65 64 20 62 79 ,.that.are.stored.as.unsigned.by
74c0 74 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 6c 75 65 73 20 77 69 6c 6c 20 68 61 76 65 te..........///.values.will.have
74e0 20 74 68 65 69 72 20 72 65 73 74 69 6e 67 20 70 6f 73 69 74 69 6f 6e 20 61 74 20 31 32 37 20 61 .their.resting.position.at.127.a
7500 6e 64 20 6e 6f 74 20 61 74 20 30 2e 20 54 68 69 73 20 69 73 20 77 68 79 20 77 65 20 65 78 70 6c nd.not.at.0..This.is.why.we.expl
7520 69 63 69 74 6c 79 20 73 74 6f 72 65 20 64 65 66 61 75 6c 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f icitly.store.default..........//
7540 2f 20 73 74 61 74 65 20 69 6e 20 61 20 6d 65 6d 6f 72 79 20 62 75 66 66 65 72 20 69 6e 73 74 65 /.state.in.a.memory.buffer.inste
7560 61 64 20 6f 66 20 61 73 73 75 6d 69 6e 67 20 7a 65 72 6f 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 ad.of.assuming.zeroes...........
7580 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 2f 20 3c 73 65 65 ///.</remarks>..........///.<see
75a0 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 53 74 61 74 65 42 75 66 66 65 72 73 2e 64 65 66 also.cref="InputStateBuffers.def
75c0 61 75 6c 74 53 74 61 74 65 42 75 66 66 65 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c aultStateBuffer"/>..........publ
75e0 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 62 6f 6f 6c 20 43 68 65 63 6b 53 74 61 74 65 ic.static.unsafe.bool.CheckState
7600 49 73 41 74 44 65 66 61 75 6c 74 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f IsAtDefault(this.InputControl.co
7620 6e 74 72 6f 6c 2c 20 76 6f 69 64 2a 20 73 74 61 74 65 50 74 72 2c 20 76 6f 69 64 2a 20 6d 61 73 ntrol,.void*.statePtr,.void*.mas
7640 6b 50 74 72 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 kPtr.=.null)..........{.........
7660 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 .....if.(control.==.null).......
7680 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 4e 75 6c ...........throw.new.ArgumentNul
76a0 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 20 20 lException(nameof(control));....
76c0 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 61 74 65 50 74 72 20 3d 3d 20 6e 75 6c 6c 29 0d ..........if.(statePtr.==.null).
76e0 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 41 72 67 75 6d .................throw.new.Argum
7700 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 73 74 61 74 65 50 74 72 entNullException(nameof(statePtr
7720 29 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 63 6f 6e 74 72 6f ));................return.contro
7740 6c 2e 43 6f 6d 70 61 72 65 53 74 61 74 65 28 73 74 61 74 65 50 74 72 2c 20 63 6f 6e 74 72 6f 6c l.CompareState(statePtr,.control
7760 2e 64 65 66 61 75 6c 74 53 74 61 74 65 50 74 72 2c 20 6d 61 73 6b 50 74 72 29 3b 0d 0a 20 20 20 .defaultStatePtr,.maskPtr);.....
7780 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 73 74 61 74 69 63 20 .....}............public.static.
77a0 75 6e 73 61 66 65 20 62 6f 6f 6c 20 43 68 65 63 6b 53 74 61 74 65 49 73 41 74 44 65 66 61 75 6c unsafe.bool.CheckStateIsAtDefaul
77c0 74 49 67 6e 6f 72 69 6e 67 4e 6f 69 73 65 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c tIgnoringNoise(this.InputControl
77e0 20 63 6f 6e 74 72 6f 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 .control)..........{............
7800 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 ..if.(control.==.null)..........
7820 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 4e 75 6c 6c 45 78 ........throw.new.ArgumentNullEx
7840 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 0d 0a 20 20 20 ception(nameof(control));.......
7860 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6f 6e 74 72 6f 6c 2e 43 68 65 63 6b 53 74 61 .........return.control.CheckSta
7880 74 65 49 73 41 74 44 65 66 61 75 6c 74 49 67 6e 6f 72 69 6e 67 4e 6f 69 73 65 28 63 6f 6e 74 72 teIsAtDefaultIgnoringNoise(contr
78a0 6f 6c 2e 63 75 72 72 65 6e 74 53 74 61 74 65 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d ol.currentStatePtr);..........}.
78c0 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 ...........public.static.unsafe.
78e0 62 6f 6f 6c 20 43 68 65 63 6b 53 74 61 74 65 49 73 41 74 44 65 66 61 75 6c 74 49 67 6e 6f 72 69 bool.CheckStateIsAtDefaultIgnori
7900 6e 67 4e 6f 69 73 65 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f ngNoise(this.InputControl.contro
7920 6c 2c 20 76 6f 69 64 2a 20 73 74 61 74 65 50 74 72 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 l,.void*.statePtr)..........{...
7940 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 20 6e 75 6c 6c 29 0d ...........if.(control.==.null).
7960 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 41 72 67 75 6d .................throw.new.Argum
7980 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 6f 6e 74 72 6f 6c 29 entNullException(nameof(control)
79a0 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 61 74 65 50 74 72 20 3d 3d 20 );..............if.(statePtr.==.
79c0 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 77 null)..................throw.new
79e0 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 73 74 .ArgumentNullException(nameof(st
7a00 61 74 65 50 74 72 29 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 atePtr));................return.
7a20 63 6f 6e 74 72 6f 6c 2e 43 68 65 63 6b 53 74 61 74 65 49 73 41 74 44 65 66 61 75 6c 74 28 73 74 control.CheckStateIsAtDefault(st
7a40 61 74 65 50 74 72 2c 20 49 6e 70 75 74 53 74 61 74 65 42 75 66 66 65 72 73 2e 73 5f 4e 6f 69 73 atePtr,.InputStateBuffers.s_Nois
7a60 65 4d 61 73 6b 42 75 66 66 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 eMaskBuffer);..........}........
7a80 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 43 ....///.<summary>..........///.C
7aa0 6f 6d 70 61 72 65 20 74 68 65 20 63 6f 6e 74 72 6f 6c 27 73 20 63 75 72 72 65 6e 74 20 73 74 61 ompare.the.control's.current.sta
7ac0 74 65 20 74 6f 20 74 68 65 20 73 74 61 74 65 20 73 74 6f 72 65 64 20 69 6e 20 3c 70 61 72 61 6d te.to.the.state.stored.in.<param
7ae0 72 65 66 20 6e 61 6d 65 3d 22 73 74 61 74 65 50 74 72 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 ref.name="statePtr"/>...........
7b00 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 20 3c 70 61 72 ///.</summary>..........///.<par
7b20 61 6d 20 6e 61 6d 65 3d 22 73 74 61 74 65 50 74 72 22 3e 53 74 61 74 65 20 6d 65 6d 6f 72 79 20 am.name="statePtr">State.memory.
7b40 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 63 6f 6e 74 72 6f 6c 27 73 20 3c 73 65 65 20 63 72 containing.the.control's.<see.cr
7b60 65 66 3d 22 73 74 61 74 65 42 6c 6f 63 6b 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 ef="stateBlock"/>.</param>......
7b80 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 72 75 65 20 69 66 20 3c 2f 72 65 74 75 72 ....///.<returns>True.if.</retur
7ba0 6e 73 3e 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 ns>..........///.<seealso.cref="
7bc0 63 75 72 72 65 6e 74 53 74 61 74 65 50 74 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 currentStatePtr"/>..........///.
7be0 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 <remarks>..........///.This.meth
7c00 6f 64 20 69 67 6e 6f 72 65 73 20 6e 6f 69 73 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 od.ignores.noise..........///...
7c20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 77 69 6c 6c 20 6e 6f 74 20 .......///.This.method.will.not.
7c40 61 63 74 75 61 6c 6c 79 20 72 65 61 64 20 76 61 6c 75 65 73 20 62 75 74 20 77 69 6c 6c 20 69 6e actually.read.values.but.will.in
7c60 73 74 65 61 64 20 63 6f 6d 70 61 72 65 20 73 74 61 74 65 20 64 69 72 65 63 74 6c 79 20 61 73 20 stead.compare.state.directly.as.
7c80 69 74 20 69 73 20 73 74 6f 72 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 20 6d 65 6d it.is.stored..........///.in.mem
7ca0 6f 72 79 2e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 7b 54 56 61 ory..<see.cref="InputControl{TVa
7cc0 6c 75 65 7d 2e 52 65 61 64 56 61 6c 75 65 22 2f 3e 20 69 73 20 6e 6f 74 20 69 6e 76 6f 6b 65 64 lue}.ReadValue"/>.is.not.invoked
7ce0 20 61 6e 64 20 74 68 75 73 20 70 72 6f 63 65 73 73 6f 72 73 20 77 69 6c 6c 0d 0a 20 20 20 20 20 .and.thus.processors.will.......
7d00 20 20 20 2f 2f 2f 20 6e 6f 74 20 62 65 20 72 75 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ...///.not.be.run...........///.
7d20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 </remarks>..........public.stati
7d40 63 20 75 6e 73 61 66 65 20 62 6f 6f 6c 20 43 6f 6d 70 61 72 65 53 74 61 74 65 49 67 6e 6f 72 69 c.unsafe.bool.CompareStateIgnori
7d60 6e 67 4e 6f 69 73 65 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f ngNoise(this.InputControl.contro
7d80 6c 2c 20 76 6f 69 64 2a 20 73 74 61 74 65 50 74 72 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 l,.void*.statePtr)..........{...
7da0 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 20 6e 75 6c 6c 29 0d ...........if.(control.==.null).
7dc0 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 41 72 67 75 6d .................throw.new.Argum
7de0 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 6f 6e 74 72 6f 6c 29 entNullException(nameof(control)
7e00 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 61 74 65 50 74 72 20 3d 3d 20 );..............if.(statePtr.==.
7e20 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 77 null)..................throw.new
7e40 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 73 74 .ArgumentNullException(nameof(st
7e60 61 74 65 50 74 72 29 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 atePtr));................return.
7e80 63 6f 6e 74 72 6f 6c 2e 43 6f 6d 70 61 72 65 53 74 61 74 65 28 63 6f 6e 74 72 6f 6c 2e 63 75 72 control.CompareState(control.cur
7ea0 72 65 6e 74 53 74 61 74 65 50 74 72 2c 20 73 74 61 74 65 50 74 72 2c 20 63 6f 6e 74 72 6f 6c 2e rentStatePtr,.statePtr,.control.
7ec0 6e 6f 69 73 65 4d 61 73 6b 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 noiseMaskPtr);..........}.......
7ee0 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>..........///.
7f00 43 6f 6d 70 61 72 65 20 74 68 65 20 63 6f 6e 74 72 6f 6c 27 73 20 73 74 6f 72 65 64 20 73 74 61 Compare.the.control's.stored.sta
7f20 74 65 20 69 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 66 69 72 73 74 53 74 61 74 65 te.in.<paramref.name="firstState
7f40 50 74 72 22 2f 3e 20 74 6f 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 65 63 6f 6e 64 Ptr"/>.to.<paramref.name="second
7f60 53 74 61 74 65 50 74 72 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d StatePtr"/>...........///.</summ
7f80 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 66 ary>..........///.<param.name="f
7fa0 69 72 73 74 53 74 61 74 65 50 74 72 22 3e 4d 65 6d 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 irstStatePtr">Memory.containing.
7fc0 74 68 65 20 63 6f 6e 74 72 6f 6c 27 73 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f the.control's.<see.cref="InputCo
7fe0 6e 74 72 6f 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 ntrol.stateBlock"/>.</param>....
8000 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 73 65 63 6f 6e 64 53 74 61 ......///.<param.name="secondSta
8020 74 65 50 74 72 22 3e 4d 65 6d 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 63 6f 6e tePtr">Memory.containing.the.con
8040 74 72 6f 6c 27 73 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 73 trol's.<see.cref="InputControl.s
8060 74 61 74 65 42 6c 6f 63 6b 22 2f 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f tateBlock"/></param>..........//
8080 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6d 61 73 6b 50 74 72 22 3e 4f 70 74 69 6f 6e 61 6c /.<param.name="maskPtr">Optional
80a0 20 6d 61 73 6b 2e 20 49 66 20 73 75 70 70 6c 69 65 64 2c 20 69 74 20 77 69 6c 6c 20 62 65 20 75 .mask..If.supplied,.it.will.be.u
80c0 73 65 64 20 74 6f 20 6d 61 73 6b 20 74 68 65 20 63 6f 6d 70 61 72 69 73 6f 6e 20 62 65 74 77 65 sed.to.mask.the.comparison.betwe
80e0 65 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 en..........///.<paramref.name="
8100 66 69 72 73 74 53 74 61 74 65 50 74 72 22 2f 3e 20 61 6e 64 20 3c 70 61 72 61 6d 72 65 66 20 6e firstStatePtr"/>.and.<paramref.n
8120 61 6d 65 3d 22 73 65 63 6f 6e 64 53 74 61 74 65 50 74 72 22 2f 3e 20 73 75 63 68 20 74 68 61 74 ame="secondStatePtr"/>.such.that
8140 20 61 6e 79 20 62 69 74 20 6e 6f 74 20 73 65 74 20 69 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 20 .any.bit.not.set.in.the.........
8160 20 2f 2f 2f 20 6d 61 73 6b 20 77 69 6c 6c 20 62 65 20 69 67 6e 6f 72 65 64 20 65 76 65 6e 20 69 .///.mask.will.be.ignored.even.i
8180 66 20 64 69 66 66 65 72 65 6e 74 20 62 65 74 77 65 65 6e 20 74 68 65 20 74 77 6f 20 73 74 61 74 f.different.between.the.two.stat
81a0 65 73 2e 20 54 68 69 73 20 63 61 6e 20 62 65 20 75 73 65 64 2c 20 66 6f 72 20 65 78 61 6d 70 6c es..This.can.be.used,.for.exampl
81c0 65 2c 20 74 6f 20 69 67 6e 6f 72 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 6f 69 73 65 20 e,.to.ignore..........///.noise.
81e0 69 6e 20 74 68 65 20 73 74 61 74 65 20 28 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f in.the.state.(<see.cref="InputCo
8200 6e 74 72 6f 6c 2e 6e 6f 69 73 65 4d 61 73 6b 50 74 72 22 2f 3e 29 2e 3c 2f 70 61 72 61 6d 3e 0d ntrol.noiseMaskPtr"/>).</param>.
8220 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 72 75 65 20 69 66 20 74 68 .........///.<returns>True.if.th
8240 65 20 73 74 61 74 65 20 69 73 20 65 71 75 69 76 61 6c 65 6e 74 20 69 6e 20 62 6f 74 68 20 6d 65 e.state.is.equivalent.in.both.me
8260 6d 6f 72 79 20 62 75 66 66 65 72 73 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 mory.buffers.</returns>.........
8280 20 2f 2f 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 55 6e 6c 69 .///.<remarks>..........///.Unli
82a0 6b 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 43 6f 6d 70 61 ke.<see.cref="InputControl.Compa
82c0 72 65 56 61 6c 75 65 22 2f 3e 2c 20 74 68 69 73 20 6d 65 74 68 6f 64 20 6f 6e 6c 79 20 63 6f 6d reValue"/>,.this.method.only.com
82e0 70 61 72 65 73 20 72 61 77 20 6d 65 6d 6f 72 79 20 73 74 61 74 65 2e 20 49 66 20 75 73 65 64 20 pares.raw.memory.state..If.used.
8300 6f 6e 20 61 20 73 74 69 63 6b 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c 0d 0a 20 20 20 20 20 20 on.a.stick,.for.example,........
8320 20 20 2f 2f 2f 20 69 74 20 6d 61 79 20 6d 65 61 6e 20 74 68 61 74 20 74 68 69 73 20 6d 65 74 68 ..///.it.may.mean.that.this.meth
8340 6f 64 20 72 65 74 75 72 6e 73 20 66 61 6c 73 65 20 66 6f 72 20 74 77 6f 20 73 74 69 63 6b 20 76 od.returns.false.for.two.stick.v
8360 61 6c 75 65 73 20 74 68 61 74 20 77 6f 75 6c 64 20 63 6f 6d 70 61 72 65 20 65 71 75 61 6c 20 75 alues.that.would.compare.equal.u
8380 73 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 43 6f 6d 70 61 72 65 56 61 6c 75 65 22 2f 3e 0d sing.<see.cref="CompareValue"/>.
83a0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 28 65 2e 67 2e 20 69 66 20 62 6f 74 68 20 73 74 69 63 6b .........///.(e.g..if.both.stick
83c0 20 76 61 6c 75 65 73 20 66 61 6c 6c 20 62 65 6c 6f 77 20 74 68 65 20 64 65 61 64 7a 6f 6e 65 29 .values.fall.below.the.deadzone)
83e0 2e 0d 0a 20 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 ...........///.</remarks>.......
8400 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 ...///.<seealso.cref="InputContr
8420 6f 6c 2e 43 6f 6d 70 61 72 65 56 61 6c 75 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c ol.CompareValue"/>..........publ
8440 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 62 6f 6f 6c 20 43 6f 6d 70 61 72 65 53 74 61 ic.static.unsafe.bool.CompareSta
8460 74 65 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 76 6f te(this.InputControl.control,.vo
8480 69 64 2a 20 66 69 72 73 74 53 74 61 74 65 50 74 72 2c 20 76 6f 69 64 2a 20 73 65 63 6f 6e 64 53 id*.firstStatePtr,.void*.secondS
84a0 74 61 74 65 50 74 72 2c 20 76 6f 69 64 2a 20 6d 61 73 6b 50 74 72 20 3d 20 6e 75 6c 6c 29 0d 0a tatePtr,.void*.maskPtr.=.null)..
84c0 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 ........{..............////REVIE
84e0 57 3a 20 66 6f 72 20 63 6f 6d 70 6f 75 6e 64 20 63 6f 6e 74 72 6f 6c 73 2c 20 64 6f 20 77 65 20 W:.for.compound.controls,.do.we.
8500 77 61 6e 74 20 74 6f 20 67 6f 20 63 68 65 63 6b 20 6c 65 61 76 65 73 20 73 6f 20 61 73 20 74 6f want.to.go.check.leaves.so.as.to
8520 20 6e 6f 74 20 70 69 63 6b 20 75 70 20 6f 6e 20 6e 6f 6e 2d 63 6f 6e 74 72 6f 6c 20 6e 6f 69 73 .not.pick.up.on.non-control.nois
8540 65 20 69 6e 20 74 68 65 20 73 74 61 74 65 3f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f e.in.the.state?..............///
8560 2f 20 20 20 20 20 20 20 20 65 2e 67 2e 20 66 72 6f 6d 20 48 49 44 20 69 6e 70 75 74 20 72 65 70 /........e.g..from.HID.input.rep
8580 6f 72 74 73 3b 20 6f 72 20 73 68 6f 75 6c 64 20 77 65 20 6a 75 73 74 20 6c 65 61 76 65 20 74 68 orts;.or.should.we.just.leave.th
85a0 61 74 20 74 6f 20 6d 61 73 6b 50 74 72 3f 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 at.to.maskPtr?................va
85c0 72 20 66 69 72 73 74 50 74 72 20 3d 20 28 62 79 74 65 2a 29 66 69 72 73 74 53 74 61 74 65 50 74 r.firstPtr.=.(byte*)firstStatePt
85e0 72 20 2b 20 28 69 6e 74 29 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 r.+.(int)control.m_StateBlock.by
8600 74 65 4f 66 66 73 65 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 65 63 6f 6e teOffset;..............var.secon
8620 64 50 74 72 20 3d 20 28 62 79 74 65 2a 29 73 65 63 6f 6e 64 53 74 61 74 65 50 74 72 20 2b 20 28 dPtr.=.(byte*)secondStatePtr.+.(
8640 69 6e 74 29 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 int)control.m_StateBlock.byteOff
8660 73 65 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6d 61 73 6b 20 3d 20 6d 61 73 set;..............var.mask.=.mas
8680 6b 50 74 72 20 21 3d 20 6e 75 6c 6c 20 3f 20 28 62 79 74 65 2a 29 6d 61 73 6b 50 74 72 20 2b 20 kPtr.!=.null.?.(byte*)maskPtr.+.
86a0 28 69 6e 74 29 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 (int)control.m_StateBlock.byteOf
86c0 66 73 65 74 20 3a 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 fset.:.null;................if.(
86e0 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 7a 65 49 6e 42 69 74 73 20 control.m_StateBlock.sizeInBits.
8700 3d 3d 20 31 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 ==.1)..............{............
8720 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 68 61 76 65 20 61 20 6d 61 73 6b 20 61 6e 64 20 74 ......//.If.we.have.a.mask.and.t
8740 68 65 20 62 69 74 20 69 73 20 73 65 74 20 69 6e 20 74 68 65 20 6d 61 73 6b 2c 20 74 68 65 20 63 he.bit.is.set.in.the.mask,.the.c
8760 6f 6e 74 72 6f 6c 20 69 73 20 74 6f 20 62 65 20 69 67 6e 6f 72 65 64 0d 0a 20 20 20 20 20 20 20 ontrol.is.to.be.ignored.........
8780 20 20 20 20 20 20 20 20 20 2f 2f 20 61 6e 64 20 74 68 75 73 20 77 65 20 63 6f 6e 73 69 64 65 72 .........//.and.thus.we.consider
87a0 20 69 74 20 61 74 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 .it.at.default.value............
87c0 20 20 20 20 20 20 20 69 66 20 28 6d 61 73 6b 20 21 3d 20 6e 75 6c 6c 20 26 26 20 4d 65 6d 6f 72 .......if.(mask.!=.null.&&.Memor
87e0 79 48 65 6c 70 65 72 73 2e 52 65 61 64 53 69 6e 67 6c 65 42 69 74 28 6d 61 73 6b 2c 20 63 6f 6e yHelpers.ReadSingleBit(mask,.con
8800 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 69 74 4f 66 66 73 65 74 29 29 0d 0a 20 trol.m_StateBlock.bitOffset))...
8820 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 74 72 75 65 3b 0d ...................return.true;.
8840 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 4d 65 6d 6f 72 79 ...................return.Memory
8860 48 65 6c 70 65 72 73 2e 52 65 61 64 53 69 6e 67 6c 65 42 69 74 28 73 65 63 6f 6e 64 50 74 72 2c Helpers.ReadSingleBit(secondPtr,
8880 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 69 74 4f 66 66 73 65 74 29 .control.m_StateBlock.bitOffset)
88a0 20 3d 3d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d 65 6d 6f 72 79 48 .==......................MemoryH
88c0 65 6c 70 65 72 73 2e 52 65 61 64 53 69 6e 67 6c 65 42 69 74 28 66 69 72 73 74 50 74 72 2c 20 63 elpers.ReadSingleBit(firstPtr,.c
88e0 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 69 74 4f 66 66 73 65 74 29 3b 0d ontrol.m_StateBlock.bitOffset);.
8900 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 72 65 .............}................re
8920 74 75 72 6e 20 4d 65 6d 6f 72 79 48 65 6c 70 65 72 73 2e 4d 65 6d 43 6d 70 42 69 74 52 65 67 69 turn.MemoryHelpers.MemCmpBitRegi
8940 6f 6e 28 66 69 72 73 74 50 74 72 2c 20 73 65 63 6f 6e 64 50 74 72 2c 0d 0a 20 20 20 20 20 20 20 on(firstPtr,.secondPtr,.........
8960 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 69 .........control.m_StateBlock.bi
8980 74 4f 66 66 73 65 74 2c 20 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 73 69 tOffset,.control.m_StateBlock.si
89a0 7a 65 49 6e 42 69 74 73 2c 20 6d 61 73 6b 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 zeInBits,.mask);..........}.....
89c0 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 62 6f 6f 6c .......public.static.unsafe.bool
89e0 20 43 6f 6d 70 61 72 65 53 74 61 74 65 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 .CompareState(this.InputControl.
8a00 63 6f 6e 74 72 6f 6c 2c 20 76 6f 69 64 2a 20 73 74 61 74 65 50 74 72 2c 20 76 6f 69 64 2a 20 6d control,.void*.statePtr,.void*.m
8a20 61 73 6b 50 74 72 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 askPtr.=.null)..........{.......
8a40 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 .......if.(control.==.null).....
8a60 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 4e .............throw.new.ArgumentN
8a80 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a ullException(nameof(control));..
8aa0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 61 74 65 50 74 72 20 3d 3d 20 6e 75 6c 6c ............if.(statePtr.==.null
8ac0 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 41 72 67 )..................throw.new.Arg
8ae0 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 73 74 61 74 65 50 umentNullException(nameof(stateP
8b00 74 72 29 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 63 6f 6e 74 tr));................return.cont
8b20 72 6f 6c 2e 43 6f 6d 70 61 72 65 53 74 61 74 65 28 63 6f 6e 74 72 6f 6c 2e 63 75 72 72 65 6e 74 rol.CompareState(control.current
8b40 53 74 61 74 65 50 74 72 2c 20 73 74 61 74 65 50 74 72 2c 20 6d 61 73 6b 50 74 72 29 3b 0d 0a 20 StatePtr,.statePtr,.maskPtr);...
8b60 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 .......}............///.<summary
8b80 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 74 75 72 6e 20 74 72 75 65 20 69 66 20 74 68 >..........///.Return.true.if.th
8ba0 65 20 63 75 72 72 65 6e 74 20 76 61 6c 75 65 20 6f 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d e.current.value.of.<paramref.nam
8bc0 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 69 73 20 64 69 66 66 65 72 65 6e 74 20 74 6f 20 74 68 e="control"/>.is.different.to.th
8be0 65 20 6f 6e 65 20 66 6f 75 6e 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 20 3c 70 61 72 e.one.found..........///.in.<par
8c00 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 61 74 65 50 74 72 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 amref.name="statePtr"/>.........
8c20 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 20 3c 70 ..///.</summary>..........///.<p
8c40 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 3e 43 6f 6e 74 72 6f 6c 20 77 68 6f 73 aram.name="control">Control.whos
8c60 65 20 73 74 61 74 65 20 74 6f 20 63 6f 6d 70 61 72 65 20 74 6f 20 77 68 61 74 20 69 73 20 73 74 e.state.to.compare.to.what.is.st
8c80 6f 72 65 64 20 69 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 74 61 74 65 50 74 72 ored.in.<paramref.name="statePtr
8ca0 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d "/>.</param>..........///.<param
8cc0 20 6e 61 6d 65 3d 22 73 74 61 74 65 50 74 72 22 3e 41 20 62 6c 6f 63 6b 20 6f 66 20 69 6e 70 75 .name="statePtr">A.block.of.inpu
8ce0 74 20 73 74 61 74 65 20 6d 65 6d 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 3c 73 t.state.memory.containing.the.<s
8d00 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 73 74 61 74 65 42 6c 6f 63 6b ee.cref="InputControl.stateBlock
8d20 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 "/>..........///.of.<paramref.na
8d40 6d 65 3d 22 63 6f 6e 74 72 6f 6c 2e 22 2f 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 me="control."/></param>.........
8d60 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 .///.<exception.cref="ArgumentNu
8d80 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e llException"><paramref.name="con
8da0 74 72 6f 6c 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 3c 70 61 72 61 6d trol"/>.is.<c>null</c>.or.<param
8dc0 72 65 66 20 6e 61 6d 65 3d 22 73 74 61 74 65 50 74 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f ref.name="statePtr"/>........../
8de0 2f 2f 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a //.is.<c>null</c>.</exception>..
8e00 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 72 75 65 20 69 66 20 74 68 65 ........///.<returns>True.if.the
8e20 20 76 61 6c 75 65 20 6f 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f .value.of.<paramref.name="contro
8e40 6c 22 2f 3e 20 73 74 6f 72 65 64 20 69 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 l"/>.stored.in.<paramref.name="s
8e60 74 61 74 65 50 74 72 22 2f 3e 20 69 73 20 64 69 66 66 65 72 65 6e 74 0d 0a 20 20 20 20 20 20 20 tatePtr"/>.is.different.........
8e80 20 2f 2f 2f 20 63 6f 6d 70 61 72 65 64 20 74 6f 20 77 68 61 74 20 3c 73 65 65 20 63 72 65 66 3d .///.compared.to.what.<see.cref=
8ea0 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 7b 54 7d 2e 52 65 61 64 56 61 6c 75 65 22 2f 3e 20 6f 66 "InputControl{T}.ReadValue"/>.of
8ec0 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 72 65 74 75 72 6e 73 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d .the.control.returns.</returns>.
8ee0 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 62 6f .........public.static.unsafe.bo
8f00 6f 6c 20 48 61 73 56 61 6c 75 65 43 68 61 6e 67 65 49 6e 53 74 61 74 65 28 74 68 69 73 20 49 6e ol.HasValueChangeInState(this.In
8f20 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 76 6f 69 64 2a 20 73 74 61 74 65 50 putControl.control,.void*.stateP
8f40 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 20 28 tr)..........{..............if.(
8f60 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 control.==.null)................
8f80 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f ..throw.new.ArgumentNullExceptio
8fa0 6e 28 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 n(nameof(control));.............
8fc0 20 69 66 20 28 73 74 61 74 65 50 74 72 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 .if.(statePtr.==.null)..........
8fe0 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 4e 75 6c 6c 45 78 ........throw.new.ArgumentNullEx
9000 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 73 74 61 74 65 50 74 72 29 29 3b 0d 0a 0d 0a 20 20 ception(nameof(statePtr));......
9020 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 43 6f 6d 70 61 72 65 ..........return.control.Compare
9040 56 61 6c 75 65 28 63 6f 6e 74 72 6f 6c 2e 63 75 72 72 65 6e 74 53 74 61 74 65 50 74 72 2c 20 73 Value(control.currentStatePtr,.s
9060 74 61 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 tatePtr);..........}............
9080 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 62 6f 6f 6c 20 48 61 73 56 61 6c public.static.unsafe.bool.HasVal
90a0 75 65 43 68 61 6e 67 65 49 6e 45 76 65 6e 74 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f ueChangeInEvent(this.InputContro
90c0 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 74 50 74 l.control,.InputEventPtr.eventPt
90e0 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 20 28 63 r)..........{..............if.(c
9100 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ontrol.==.null).................
9120 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e .throw.new.ArgumentNullException
9140 28 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 20 (nameof(control));..............
9160 69 66 20 28 21 65 76 65 6e 74 50 74 72 2e 76 61 6c 69 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 if.(!eventPtr.valid)............
9180 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 ......throw.new.ArgumentNullExce
91a0 70 74 69 6f 6e 28 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 20 ption(nameof(eventPtr));........
91c0 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6f 6e 74 72 6f 6c 2e 43 6f 6d 70 61 72 65 56 61 ........return.control.CompareVa
91e0 6c 75 65 28 63 6f 6e 74 72 6f 6c 2e 63 75 72 72 65 6e 74 53 74 61 74 65 50 74 72 2c 20 63 6f 6e lue(control.currentStatePtr,.con
9200 74 72 6f 6c 2e 47 65 74 53 74 61 74 65 50 74 72 46 72 6f 6d 53 74 61 74 65 45 76 65 6e 74 28 65 trol.GetStatePtrFromStateEvent(e
9220 76 65 6e 74 50 74 72 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 ventPtr));..........}...........
9240 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 47 69 76 65 .///.<summary>..........///.Give
9260 6e 20 61 20 3c 73 65 65 20 63 72 65 66 3d 22 53 74 61 74 65 45 76 65 6e 74 22 2f 3e 20 6f 72 20 n.a.<see.cref="StateEvent"/>.or.
9280 3c 73 65 65 20 63 72 65 66 3d 22 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 22 2f 3e 2c 20 72 <see.cref="DeltaStateEvent"/>,.r
92a0 65 74 75 72 6e 20 74 68 65 20 72 61 77 20 6d 65 6d 6f 72 79 20 70 6f 69 6e 74 65 72 20 74 68 61 eturn.the.raw.memory.pointer.tha
92c0 74 20 63 61 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 65 20 75 73 65 64 2c 20 66 6f 72 20 t.can..........///.be.used,.for.
92e0 65 78 61 6d 70 6c 65 2c 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f example,.with.<see.cref="InputCo
9300 6e 74 72 6f 6c 7b 54 7d 2e 52 65 61 64 56 61 6c 75 65 46 72 6f 6d 53 74 61 74 65 22 2f 3e 20 74 ntrol{T}.ReadValueFromState"/>.t
9320 6f 20 72 65 61 64 20 6f 75 74 20 74 68 65 20 76 61 6c 75 65 20 6f 66 20 3c 70 61 72 61 6d 72 65 o.read.out.the.value.of.<paramre
9340 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 f.name="control"/>..........///.
9360 63 6f 6e 74 61 69 6e 65 64 20 69 6e 20 74 68 65 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 contained.in.the.event..........
9380 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 20 3c 70 61 .///.</summary>..........///.<pa
93a0 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 3e 43 6f 6e 74 72 6f 6c 20 74 6f 20 61 63 ram.name="control">Control.to.ac
93c0 63 65 73 73 20 73 74 61 74 65 20 66 6f 72 20 69 6e 20 74 68 65 20 67 69 76 65 6e 20 73 74 61 74 cess.state.for.in.the.given.stat
93e0 65 20 65 76 65 6e 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 e.event.</param>..........///.<p
9400 61 72 61 6d 20 6e 61 6d 65 3d 22 65 76 65 6e 74 50 74 72 22 3e 41 20 3c 73 65 65 20 63 72 65 66 aram.name="eventPtr">A.<see.cref
9420 3d 22 53 74 61 74 65 45 76 65 6e 74 22 2f 3e 20 6f 72 20 3c 73 65 65 20 63 72 65 66 3d 22 44 65 ="StateEvent"/>.or.<see.cref="De
9440 6c 74 61 53 74 61 74 65 45 76 65 6e 74 22 2f 3e 20 63 6f 6e 74 61 69 6e 69 6e 67 20 69 6e 70 75 ltaStateEvent"/>.containing.inpu
9460 74 20 73 74 61 74 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 t.state.</param>..........///.<r
9480 65 74 75 72 6e 73 3e 41 20 70 6f 69 6e 74 65 72 20 74 68 61 74 20 63 61 6e 20 62 65 20 75 73 65 eturns>A.pointer.that.can.be.use
94a0 64 20 77 69 74 68 20 6d 65 74 68 6f 64 73 20 73 75 63 68 20 61 73 20 3c 73 65 65 20 63 72 65 66 d.with.methods.such.as.<see.cref
94c0 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 7b 54 56 61 6c 75 65 7d 2e 52 65 61 64 56 61 6c 75 65 ="InputControl{TValue}.ReadValue
94e0 46 72 6f 6d 53 74 61 74 65 22 2f 3e 20 6f 72 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 0d 0a 20 20 20 FromState"/>.or.<c>null</c>.....
9500 20 20 20 20 20 2f 2f 2f 20 69 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 65 76 65 6e .....///.if.<paramref.name="even
9520 74 50 74 72 22 2f 3e 20 64 6f 65 73 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 73 74 61 74 65 20 66 tPtr"/>.does.not.contain.state.f
9540 6f 72 20 74 68 65 20 67 69 76 65 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e or.the.given.<paramref.name="con
9560 74 72 6f 6c 22 2f 3e 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 trol"/>.</returns>..........///.
9580 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 <exception.cref="ArgumentNullExc
95a0 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 eption"><paramref.name="control"
95c0 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 2d 6f 72 2d 20 3c 70 61 72 61 6d 72 65 66 />.is.<c>null</c>.-or-.<paramref
95e0 20 6e 61 6d 65 3d 22 65 76 65 6e 74 50 74 72 22 2f 3e 20 69 73 20 69 6e 76 61 6c 69 64 2e 3c 2f .name="eventPtr"/>.is.invalid.</
9600 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 exception>..........///.<excepti
9620 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 6e 22 3e 3c 70 61 72 on.cref="ArgumentException"><par
9640 61 6d 72 65 66 20 6e 61 6d 65 3d 22 65 76 65 6e 74 50 74 72 22 2f 3e 20 69 73 20 6e 6f 74 20 61 amref.name="eventPtr"/>.is.not.a
9660 20 3c 73 65 65 20 63 72 65 66 3d 22 53 74 61 74 65 45 76 65 6e 74 22 2f 3e 20 6f 72 20 3c 73 65 .<see.cref="StateEvent"/>.or.<se
9680 65 20 63 72 65 66 3d 22 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 22 2f 3e 2e 3c 2f 65 78 63 e.cref="DeltaStateEvent"/>.</exc
96a0 65 70 74 69 6f 6e 3e 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 eption>..........///.<remarks>..
96c0 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 20 67 69 76 65 6e 20 ........///.Note.that.the.given.
96e0 73 74 61 74 65 20 65 76 65 6e 74 20 6d 75 73 74 20 68 61 76 65 20 74 68 65 20 73 61 6d 65 20 73 state.event.must.have.the.same.s
9700 74 61 74 65 20 66 6f 72 6d 61 74 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 tate.format.(see.<see.cref="Inpu
9720 74 53 74 61 74 65 42 6c 6f 63 6b 2e 66 6f 72 6d 61 74 22 2f 3e 29 20 61 73 20 74 68 65 20 64 65 tStateBlock.format"/>).as.the.de
9740 76 69 63 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 77 68 69 63 68 20 3c 70 61 72 61 vice..........///.to.which.<para
9760 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 62 65 6c 6f 6e 67 73 2e 20 49 mref.name="control"/>.belongs..I
9780 66 20 74 68 69 73 20 69 73 20 6e 6f 74 20 74 68 65 20 63 61 73 65 2c 20 74 68 65 20 6d 65 74 68 f.this.is.not.the.case,.the.meth
97a0 6f 64 20 77 69 6c 6c 20 69 6e 76 61 72 69 61 62 6c 79 20 72 65 74 75 72 6e 20 3c 63 3e 6e 75 6c od.will.invariably.return.<c>nul
97c0 6c 3c 2f 63 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f l</c>...........///..........///
97e0 20 49 6e 20 70 72 61 63 74 69 63 65 2c 20 74 68 69 73 20 6d 65 61 6e 73 20 74 68 61 74 20 74 68 .In.practice,.this.means.that.th
9800 65 20 6d 65 74 68 6f 64 20 63 61 6e 6e 6f 74 20 62 65 20 75 73 65 64 20 77 69 74 68 20 74 6f 75 e.method.cannot.be.used.with.tou
9820 63 68 20 65 76 65 6e 74 73 20 6f 72 2c 20 69 6e 20 67 65 6e 65 72 61 6c 2c 20 77 69 74 68 20 65 ch.events.or,.in.general,.with.e
9840 76 65 6e 74 73 20 73 65 6e 74 20 74 6f 20 64 65 76 69 63 65 73 0d 0a 20 20 20 20 20 20 20 20 2f vents.sent.to.devices........../
9860 2f 2f 20 74 68 61 74 20 69 6d 70 6c 65 6d 65 6e 74 20 3c 73 65 65 20 63 72 65 66 3d 22 49 49 6e //.that.implement.<see.cref="IIn
9880 70 75 74 53 74 61 74 65 43 61 6c 6c 62 61 63 6b 52 65 63 65 69 76 65 72 22 2f 3e 20 28 77 68 69 putStateCallbackReceiver"/>.(whi
98a0 63 68 20 3c 73 65 65 20 63 72 65 66 3d 22 54 6f 75 63 68 73 63 72 65 65 6e 22 2f 3e 20 64 6f 65 ch.<see.cref="Touchscreen"/>.doe
98c0 73 29 20 65 78 63 65 70 74 20 69 66 20 74 68 65 20 65 76 65 6e 74 0d 0a 20 20 20 20 20 20 20 20 s).except.if.the.event..........
98e0 2f 2f 2f 20 69 73 20 69 6e 20 74 68 65 20 73 61 6d 65 20 73 74 61 74 65 20 66 6f 72 6d 61 74 20 ///.is.in.the.same.state.format.
9900 61 73 20 74 68 65 20 64 65 76 69 63 65 2e 20 54 6f 75 63 68 20 65 76 65 6e 74 73 20 77 69 6c 6c as.the.device..Touch.events.will
9920 20 67 65 6e 65 72 61 6c 6c 79 20 62 65 20 73 65 6e 74 20 61 73 20 73 74 61 74 65 20 65 76 65 6e .generally.be.sent.as.state.even
9940 74 73 20 63 6f 6e 74 61 69 6e 69 6e 67 20 6f 6e 6c 79 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 ts.containing.only.the..........
9960 2f 2f 2f 20 73 74 61 74 65 20 6f 66 20 61 20 73 69 6e 67 6c 65 20 3c 73 65 65 20 63 72 65 66 3d ///.state.of.a.single.<see.cref=
9980 22 43 6f 6e 74 72 6f 6c 73 2e 54 6f 75 63 68 43 6f 6e 74 72 6f 6c 22 2f 3e 2c 20 6e 6f 74 20 74 "Controls.TouchControl"/>,.not.t
99a0 68 65 20 73 74 61 74 65 20 6f 66 20 74 68 65 20 65 6e 74 69 72 65 20 3c 73 65 65 20 63 72 65 66 he.state.of.the.entire.<see.cref
99c0 3d 22 54 6f 75 63 68 73 63 72 65 65 6e 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ="Touchscreen"/>...........///.<
99e0 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 /remarks>..........public.static
9a00 20 75 6e 73 61 66 65 20 76 6f 69 64 2a 20 47 65 74 53 74 61 74 65 50 74 72 46 72 6f 6d 53 74 61 .unsafe.void*.GetStatePtrFromSta
9a20 74 65 45 76 65 6e 74 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f teEvent(this.InputControl.contro
9a40 6c 2c 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 20 65 76 65 6e 74 50 74 72 29 0d 0a 20 20 20 20 l,.InputEventPtr.eventPtr)......
9a60 20 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 ....{..............if.(control.=
9a80 3d 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 =.null)..................throw.n
9aa0 65 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 ew.ArgumentNullException(nameof(
9ac0 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 65 76 65 control));..............if.(!eve
9ae0 6e 74 50 74 72 2e 76 61 6c 69 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 ntPtr.valid)..................th
9b00 72 6f 77 20 6e 65 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 row.new.ArgumentNullException(na
9b20 6d 65 6f 66 28 65 76 65 6e 74 50 74 72 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 meof(eventPtr));................
9b40 75 69 6e 74 20 73 74 61 74 65 4f 66 66 73 65 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 46 uint.stateOffset;..............F
9b60 6f 75 72 43 43 20 73 74 61 74 65 46 6f 72 6d 61 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ourCC.stateFormat;..............
9b80 75 69 6e 74 20 73 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 uint.stateSizeInBytes;..........
9ba0 20 20 20 20 76 6f 69 64 2a 20 73 74 61 74 65 50 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ....void*.statePtr;.............
9bc0 20 69 66 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 .if.(eventPtr.IsA<DeltaStateEven
9be0 74 3e 28 29 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 t>())..............{............
9c00 20 20 20 20 20 20 76 61 72 20 64 65 6c 74 61 45 76 65 6e 74 20 3d 20 44 65 6c 74 61 53 74 61 74 ......var.deltaEvent.=.DeltaStat
9c20 65 45 76 65 6e 74 2e 46 72 6f 6d 28 65 76 65 6e 74 50 74 72 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 eEvent.From(eventPtr);..........
9c40 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 69 74 27 73 20 61 20 64 65 6c 74 61 20 65 76 65 ..........//.If.it's.a.delta.eve
9c60 6e 74 2c 20 77 65 20 6e 65 65 64 20 74 6f 20 73 75 62 74 72 61 63 74 20 74 68 65 20 64 65 6c 74 nt,.we.need.to.subtract.the.delt
9c80 61 20 73 74 61 74 65 20 6f 66 66 73 65 74 20 69 66 20 69 74 27 73 20 6e 6f 74 20 73 65 74 20 74 a.state.offset.if.it's.not.set.t
9ca0 6f 20 74 68 65 20 72 6f 6f 74 20 6f 66 20 74 68 65 20 64 65 76 69 63 65 0d 0a 20 20 20 20 20 20 o.the.root.of.the.device........
9cc0 20 20 20 20 20 20 20 20 20 20 73 74 61 74 65 4f 66 66 73 65 74 20 3d 20 64 65 6c 74 61 45 76 65 ..........stateOffset.=.deltaEve
9ce0 6e 74 2d 3e 73 74 61 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 nt->stateOffset;................
9d00 20 20 73 74 61 74 65 46 6f 72 6d 61 74 20 3d 20 64 65 6c 74 61 45 76 65 6e 74 2d 3e 73 74 61 74 ..stateFormat.=.deltaEvent->stat
9d20 65 46 6f 72 6d 61 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 74 65 53 eFormat;..................stateS
9d40 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 64 65 6c 74 61 45 76 65 6e 74 2d 3e 64 65 6c 74 61 53 74 izeInBytes.=.deltaEvent->deltaSt
9d60 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 20 20 20 20 20 20 20 ateSizeInBytes;.................
9d80 20 73 74 61 74 65 50 74 72 20 3d 20 64 65 6c 74 61 45 76 65 6e 74 2d 3e 64 65 6c 74 61 53 74 61 .statePtr.=.deltaEvent->deltaSta
9da0 74 65 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 20 te;..............}..............
9dc0 65 6c 73 65 20 69 66 20 28 65 76 65 6e 74 50 74 72 2e 49 73 41 3c 53 74 61 74 65 45 76 65 6e 74 else.if.(eventPtr.IsA<StateEvent
9de0 3e 28 29 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 >())..............{.............
9e00 20 20 20 20 20 76 61 72 20 73 74 61 74 65 45 76 65 6e 74 20 3d 20 53 74 61 74 65 45 76 65 6e 74 .....var.stateEvent.=.StateEvent
9e20 2e 46 72 6f 6d 28 65 76 65 6e 74 50 74 72 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .From(eventPtr);................
9e40 20 20 20 20 73 74 61 74 65 4f 66 66 73 65 74 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ....stateOffset.=.0;............
9e60 20 20 20 20 20 20 73 74 61 74 65 46 6f 72 6d 61 74 20 3d 20 73 74 61 74 65 45 76 65 6e 74 2d 3e ......stateFormat.=.stateEvent->
9e80 73 74 61 74 65 46 6f 72 6d 61 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 stateFormat;..................st
9ea0 61 74 65 53 69 7a 65 49 6e 42 79 74 65 73 20 3d 20 73 74 61 74 65 45 76 65 6e 74 2d 3e 73 74 61 ateSizeInBytes.=.stateEvent->sta
9ec0 74 65 53 69 7a 65 49 6e 42 79 74 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 teSizeInBytes;..................
9ee0 73 74 61 74 65 50 74 72 20 3d 20 73 74 61 74 65 45 76 65 6e 74 2d 3e 73 74 61 74 65 3b 0d 0a 20 statePtr.=.stateEvent->state;...
9f00 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 65 6c 73 65 0d 0a ...........}..............else..
9f20 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 74 ............{..................t
9f40 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 28 22 45 76 65 6e hrow.new.ArgumentException("Even
9f60 74 20 6d 75 73 74 20 62 65 20 61 20 73 74 61 74 65 20 6f 72 20 64 65 6c 74 61 20 73 74 61 74 65 t.must.be.a.state.or.delta.state
9f80 20 65 76 65 6e 74 22 2c 20 6e 61 6d 65 6f 66 28 65 76 65 6e 74 50 74 72 29 29 3b 0d 0a 20 20 20 .event",.nameof(eventPtr));.....
9fa0 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 20 4d 61 6b .........}................//.Mak
9fc0 65 20 73 75 72 65 20 77 65 20 68 61 76 65 20 61 20 73 74 61 74 65 20 65 76 65 6e 74 20 63 6f 6d e.sure.we.have.a.state.event.com
9fe0 70 61 74 69 62 6c 65 20 77 69 74 68 20 6f 75 72 20 64 65 76 69 63 65 2e 20 54 68 65 20 65 76 65 patible.with.our.device..The.eve
a000 6e 74 20 64 6f 65 73 6e 27 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 68 61 76 65 20 nt.doesn't..............//.have.
a020 74 6f 20 62 65 20 73 70 65 63 69 66 69 63 61 6c 6c 79 20 66 6f 72 20 6f 75 72 20 64 65 76 69 63 to.be.specifically.for.our.devic
a040 65 20 28 77 65 20 64 6f 6e 27 74 20 72 65 71 75 69 72 65 20 64 65 76 69 63 65 20 49 44 73 20 74 e.(we.don't.require.device.IDs.t
a060 6f 20 6d 61 74 63 68 29 20 62 75 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 65 o.match).but..............//.the
a080 20 66 6f 72 6d 61 74 73 20 68 61 76 65 20 74 6f 20 6d 61 74 63 68 20 61 6e 64 20 74 68 65 20 73 .formats.have.to.match.and.the.s
a0a0 69 7a 65 20 6d 75 73 74 20 62 65 20 77 69 74 68 69 6e 20 72 61 6e 67 65 20 6f 66 20 77 68 61 74 ize.must.be.within.range.of.what
a0c0 20 77 65 27 72 65 20 74 72 79 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 6f .we're.trying..............//.to
a0e0 20 72 65 61 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 20 3d .read...............var.device.=
a100 20 63 6f 6e 74 72 6f 6c 2e 64 65 76 69 63 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 .control.device;..............if
a120 20 28 73 74 61 74 65 46 6f 72 6d 61 74 20 21 3d 20 64 65 76 69 63 65 2e 6d 5f 53 74 61 74 65 42 .(stateFormat.!=.device.m_StateB
a140 6c 6f 63 6b 2e 66 6f 72 6d 61 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 lock.format)..............{.....
a160 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 74 68 65 20 64 65 76 69 63 65 20 69 73 .............//.If.the.device.is
a180 20 61 6e 20 49 49 6e 70 75 74 53 74 61 74 65 43 61 6c 6c 62 61 63 6b 52 65 63 65 69 76 65 72 2c .an.IInputStateCallbackReceiver,
a1a0 20 74 68 65 72 65 27 73 20 61 20 63 68 61 6e 63 65 20 69 74 20 61 63 74 75 61 6c 6c 79 20 72 65 .there's.a.chance.it.actually.re
a1c0 63 6f 67 6e 69 7a 65 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 65 cognizes..................//.the
a1e0 20 73 74 61 74 65 20 66 6f 72 6d 61 74 20 69 6e 20 74 68 65 20 65 76 65 6e 74 20 61 6e 64 20 63 .state.format.in.the.event.and.c
a200 61 6e 20 63 6f 72 72 65 6c 61 74 65 20 69 74 20 74 6f 20 74 68 65 20 73 74 61 74 65 20 61 73 20 an.correlate.it.to.the.state.as.
a220 66 6f 75 6e 64 20 6f 6e 20 74 68 65 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 found.on.the.device.............
a240 20 20 20 20 20 20 69 66 20 28 21 64 65 76 69 63 65 2e 68 61 73 53 74 61 74 65 43 61 6c 6c 62 61 ......if.(!device.hasStateCallba
a260 63 6b 73 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 21 28 28 49 cks.||......................!((I
a280 49 6e 70 75 74 53 74 61 74 65 43 61 6c 6c 62 61 63 6b 52 65 63 65 69 76 65 72 29 64 65 76 69 63 InputStateCallbackReceiver)devic
a2a0 65 29 2e 47 65 74 53 74 61 74 65 4f 66 66 73 65 74 46 6f 72 45 76 65 6e 74 28 63 6f 6e 74 72 6f e).GetStateOffsetForEvent(contro
a2c0 6c 2c 20 65 76 65 6e 74 50 74 72 2c 20 72 65 66 20 73 74 61 74 65 4f 66 66 73 65 74 29 29 0d 0a l,.eventPtr,.ref.stateOffset))..
a2e0 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 75 6c 6c 3b ....................return.null;
a300 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 2f ..............}................/
a320 2f 20 4f 6e 63 65 20 61 20 64 65 76 69 63 65 20 68 61 73 20 62 65 65 6e 20 61 64 64 65 64 2c 20 /.Once.a.device.has.been.added,.
a340 67 6c 6f 62 61 6c 20 73 74 61 74 65 20 62 75 66 66 65 72 20 6f 66 66 73 65 74 73 20 61 72 65 20 global.state.buffer.offsets.are.
a360 62 61 6b 65 64 20 69 6e 74 6f 20 63 6f 6e 74 72 6f 6c 20 68 69 65 72 61 72 63 68 69 65 73 2e 0d baked.into.control.hierarchies..
a380 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 6e 65 65 64 20 74 6f 20 75 6e 73 75 62 .............//.We.need.to.unsub
a3a0 74 72 61 63 74 20 74 68 6f 73 65 20 6f 66 66 73 65 74 73 20 68 65 72 65 2e 0d 0a 20 20 20 20 20 tract.those.offsets.here........
a3c0 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 49 66 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 .......//.NOTE:.If.the.given.dev
a3e0 69 63 65 20 68 61 73 20 6e 6f 74 20 61 63 74 75 61 6c 6c 79 20 62 65 65 6e 20 61 64 64 65 64 20 ice.has.not.actually.been.added.
a400 74 6f 20 74 68 65 20 73 79 73 74 65 6d 2c 20 74 68 65 20 6f 66 66 73 65 74 20 69 73 20 73 69 6d to.the.system,.the.offset.is.sim
a420 70 6c 79 20 30 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 61 6e 64 20 ply.0..............//.......and.
a440 74 68 69 73 20 69 73 20 61 20 68 61 72 6d 6c 65 73 73 20 4e 4f 50 2e 0d 0a 20 20 20 20 20 20 20 this.is.a.harmless.NOP..........
a460 20 20 20 20 20 73 74 61 74 65 4f 66 66 73 65 74 20 2b 3d 20 64 65 76 69 63 65 2e 6d 5f 53 74 61 .....stateOffset.+=.device.m_Sta
a480 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 20 20 20 20 20 20 teBlock.byteOffset;.............
a4a0 20 20 20 2f 2f 20 52 65 74 75 72 6e 20 6e 75 6c 6c 20 69 66 20 73 74 61 74 65 20 69 73 20 6f 75 ...//.Return.null.if.state.is.ou
a4c0 74 20 6f 66 20 72 61 6e 67 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e t.of.range...............var.con
a4e0 74 72 6f 6c 4f 66 66 73 65 74 20 3d 20 28 69 6e 74 29 63 6f 6e 74 72 6f 6c 2e 6d 5f 53 74 61 74 trolOffset.=.(int)control.m_Stat
a500 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 20 2d 20 73 74 61 74 65 4f 66 66 73 65 74 3b eBlock.byteOffset.-.stateOffset;
a520 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 4f 66 66 73 65 74 20 ..............if.(controlOffset.
a540 3c 20 30 20 7c 7c 20 63 6f 6e 74 72 6f 6c 4f 66 66 73 65 74 20 2b 20 63 6f 6e 74 72 6f 6c 2e 6d <.0.||.controlOffset.+.control.m
a560 5f 53 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 _StateBlock.alignedSizeInBytes.>
a580 20 73 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)..............
a5a0 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ....return.null;................
a5c0 72 65 74 75 72 6e 20 28 62 79 74 65 2a 29 73 74 61 74 65 50 74 72 20 2d 20 28 69 6e 74 29 73 74 return.(byte*)statePtr.-.(int)st
a5e0 61 74 65 4f 66 66 73 65 74 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 ateOffset;..........}...........
a600 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 51 75 65 75 .///.<summary>..........///.Queu
a620 65 20 61 20 76 61 6c 75 65 20 63 68 61 6e 67 65 20 6f 6e 20 74 68 65 20 67 69 76 65 6e 20 3c 70 e.a.value.change.on.the.given.<p
a640 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 77 68 69 63 68 20 77 aramref.name="control"/>.which.w
a660 69 6c 6c 20 62 65 20 70 72 6f 63 65 73 73 65 64 20 61 6e 64 20 74 61 6b 65 20 65 66 66 65 63 74 ill.be.processed.and.take.effect
a680 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 20 74 68 65 20 6e 65 78 74 20 69 6e 70 75 74 20 ..........///.in.the.next.input.
a6a0 75 70 64 61 74 65 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 update...........///.</summary>.
a6c0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f .........///.<param.name="contro
a6e0 6c 22 3e 43 6f 6e 74 72 6f 6c 20 74 6f 20 63 68 61 6e 67 65 20 74 68 65 20 76 61 6c 75 65 20 6f l">Control.to.change.the.value.o
a700 66 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e f.</param>..........///.<param.n
a720 61 6d 65 3d 22 76 61 6c 75 65 22 3e 4e 65 77 20 76 61 6c 75 65 20 66 6f 72 20 74 68 65 20 63 6f ame="value">New.value.for.the.co
a740 6e 74 72 6f 6c 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 ntrol.</param>..........///.<par
a760 61 6d 20 6e 61 6d 65 3d 22 74 69 6d 65 22 3e 4f 70 74 69 6f 6e 61 6c 20 74 69 6d 65 20 61 74 20 am.name="time">Optional.time.at.
a780 77 68 69 63 68 20 74 68 65 20 76 61 6c 75 65 20 63 68 61 6e 67 65 20 73 68 6f 75 6c 64 20 74 61 which.the.value.change.should.ta
a7a0 6b 65 20 65 66 66 65 63 74 2e 20 49 66 20 73 65 74 2c 20 74 68 69 73 20 77 69 6c 6c 20 62 65 63 ke.effect..If.set,.this.will.bec
a7c0 6f 6d 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 3c 73 65 65 20 63 72 65 66 3d 22 ome..........///.the.<see.cref="
a7e0 49 6e 70 75 74 45 76 65 6e 74 2e 74 69 6d 65 22 2f 3e 20 6f 66 20 74 68 65 20 71 75 65 75 65 64 InputEvent.time"/>.of.the.queued
a800 20 65 76 65 6e 74 2e 20 49 66 20 74 68 65 20 74 69 6d 65 20 69 73 20 69 6e 20 74 68 65 20 66 75 .event..If.the.time.is.in.the.fu
a820 74 75 72 65 2c 20 74 68 65 20 65 76 65 6e 74 20 77 69 6c 6c 20 6e 6f 74 0d 0a 20 20 20 20 20 20 ture,.the.event.will.not........
a840 20 20 2f 2f 2f 20 62 65 20 70 72 6f 63 65 73 73 65 64 20 75 6e 74 69 6c 20 69 74 20 66 61 6c 6c ..///.be.processed.until.it.fall
a860 73 20 77 69 74 68 69 6e 20 74 68 65 20 74 69 6d 65 20 6f 66 20 61 6e 20 69 6e 70 75 74 20 75 70 s.within.the.time.of.an.input.up
a880 64 61 74 65 20 73 6c 69 63 65 20 28 65 78 63 65 70 74 20 69 66 20 3c 73 65 65 20 63 72 65 66 3d date.slice.(except.if.<see.cref=
a8a0 22 49 6e 70 75 74 53 65 74 74 69 6e 67 73 2e 74 69 6d 65 73 6c 69 63 65 45 76 65 6e 74 73 22 2f "InputSettings.timesliceEvents"/
a8c0 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 66 61 6c 73 65 2c 20 69 6e 20 77 68 69 63 >..........///.is.false,.in.whic
a8e0 68 20 63 61 73 65 20 74 68 65 20 65 76 65 6e 74 20 77 69 6c 6c 20 69 6e 76 61 72 69 61 62 6c 79 h.case.the.event.will.invariably
a900 20 62 65 20 63 6f 6e 73 75 6d 65 64 20 69 6e 20 74 68 65 20 6e 65 78 74 20 75 70 64 61 74 65 29 .be.consumed.in.the.next.update)
a920 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 74 79 70 65 70 61 72 61 .</param>..........///.<typepara
a940 6d 20 6e 61 6d 65 3d 22 54 56 61 6c 75 65 22 3e 54 79 70 65 20 6f 66 20 76 61 6c 75 65 2e 3c 2f m.name="TValue">Type.of.value.</
a960 74 79 70 65 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 typeparam>..........///.<excepti
a980 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e on.cref="ArgumentNullException">
a9a0 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 69 73 20 6e 75 <paramref.name="control"/>.is.nu
a9c0 6c 6c 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 ll.</exception>..........public.
a9e0 73 74 61 74 69 63 20 76 6f 69 64 20 51 75 65 75 65 56 61 6c 75 65 43 68 61 6e 67 65 3c 54 56 61 static.void.QueueValueChange<TVa
aa00 6c 75 65 3e 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3c 54 56 61 6c 75 65 3e 20 63 lue>(this.InputControl<TValue>.c
aa20 6f 6e 74 72 6f 6c 2c 20 54 56 61 6c 75 65 20 76 61 6c 75 65 2c 20 64 6f 75 62 6c 65 20 74 69 6d ontrol,.TValue.value,.double.tim
aa40 65 20 3d 20 2d 31 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 e.=.-1)..............where.TValu
aa60 65 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 e.:.struct..........{...........
aa80 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 ...if.(control.==.null).........
aaa0 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 4e 75 6c 6c 45 .........throw.new.ArgumentNullE
aac0 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 0d 0a 20 20 xception(nameof(control));......
aae0 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 69 66 20 69 74 27 73 20 6e 6f 74 20 ..........////TODO:.if.it's.not.
ab00 61 20 62 69 74 2d 61 64 64 72 65 73 73 69 6e 67 20 63 6f 6e 74 72 6f 6c 2c 20 73 65 6e 64 20 61 a.bit-addressing.control,.send.a
ab20 20 64 65 6c 74 61 20 73 74 61 74 65 20 63 68 61 6e 67 65 20 6f 6e 6c 79 0d 0a 20 20 20 20 20 20 .delta.state.change.only........
ab40 20 20 20 20 20 20 75 73 69 6e 67 20 28 53 74 61 74 65 45 76 65 6e 74 2e 46 72 6f 6d 28 63 6f 6e ......using.(StateEvent.From(con
ab60 74 72 6f 6c 2e 64 65 76 69 63 65 2c 20 6f 75 74 20 76 61 72 20 65 76 65 6e 74 50 74 72 29 29 0d trol.device,.out.var.eventPtr)).
ab80 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 20 .............{..................
aba0 69 66 20 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 if.(time.>=.0)..................
abc0 20 20 20 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 ....eventPtr.time.=.time;.......
abe0 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 57 72 69 74 65 56 61 6c 75 65 49 6e 74 ...........control.WriteValueInt
ac00 6f 45 76 65 6e 74 28 76 61 6c 75 65 2c 20 65 76 65 6e 74 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 oEvent(value,.eventPtr);........
ac20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 51 75 65 75 65 45 76 65 6e 74 ..........InputSystem.QueueEvent
ac40 28 65 76 65 6e 74 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 (eventPtr);..............}......
ac60 20 20 20 20 7d 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 ....}............///.<summary>..
ac80 20 20 20 20 20 20 20 20 2f 2f 2f 20 4d 6f 64 69 66 79 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d ........///.Modify.<paramref.nam
aca0 65 3d 22 6e 65 77 53 74 61 74 65 22 2f 3e 20 74 6f 20 77 72 69 74 65 20 61 6e 20 61 63 63 75 6d e="newState"/>.to.write.an.accum
acc0 75 6c 61 74 65 64 20 76 61 6c 75 65 20 6f 66 20 74 68 65 20 63 6f 6e 74 72 6f 6c 0d 0a 20 20 20 ulated.value.of.the.control.....
ace0 20 20 20 20 20 2f 2f 2f 20 72 61 74 68 65 72 20 74 68 61 6e 20 74 68 65 20 76 61 6c 75 65 20 63 .....///.rather.than.the.value.c
ad00 75 72 72 65 6e 74 6c 79 20 66 6f 75 6e 64 20 69 6e 20 74 68 65 20 65 76 65 6e 74 2e 0d 0a 20 20 urrently.found.in.the.event.....
ad20 20 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 ......///.</summary>..........//
ad40 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 3e 43 6f 6e 74 72 6f 6c 20 /.<param.name="control">Control.
ad60 74 6f 20 70 65 72 66 6f 72 6d 20 74 68 65 20 61 63 63 75 6d 75 6c 61 74 69 6f 6e 20 6f 6e 2e 3c to.perform.the.accumulation.on.<
ad80 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 /param>..........///.<param.name
ada0 3d 22 63 75 72 72 65 6e 74 53 74 61 74 65 50 74 72 22 3e 4d 65 6d 6f 72 79 20 63 6f 6e 74 61 69 ="currentStatePtr">Memory.contai
adc0 6e 69 6e 67 20 74 68 65 20 63 6f 6e 74 72 6f 6c 27 73 20 63 75 72 72 65 6e 74 20 73 74 61 74 65 ning.the.control's.current.state
ade0 2e 20 53 65 65 20 3c 73 65 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 72 65 66 3d 22 49 6e ..See.<see..........///.cref="In
ae00 70 75 74 43 6f 6e 74 72 6f 6c 2e 63 75 72 72 65 6e 74 53 74 61 74 65 50 74 72 22 2f 3e 2e 3c 2f putControl.currentStatePtr"/>.</
ae20 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d param>..........///.<param.name=
ae40 22 6e 65 77 53 74 61 74 65 22 3e 45 76 65 6e 74 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 "newState">Event.containing.the.
ae60 6e 65 77 20 73 74 61 74 65 20 61 62 6f 75 74 20 74 6f 20 62 65 20 77 72 69 74 74 65 6e 20 74 6f new.state.about.to.be.written.to
ae80 20 74 68 65 20 64 65 76 69 63 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f .the.device.</param>..........//
aea0 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 /.<exception.cref="ArgumentNullE
aec0 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f xception"><paramref.name="contro
aee0 6c 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e l"/>.is.<c>null</c>.</exception>
af00 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>.........
af20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 72 65 61 64 73 20 74 68 65 20 63 75 72 72 65 .///.This.method.reads.the.curre
af40 6e 74 2c 20 75 6e 70 72 6f 63 65 73 73 65 64 20 76 61 6c 75 65 20 6f 66 20 74 68 65 20 63 6f 6e nt,.unprocessed.value.of.the.con
af60 74 72 6f 6c 20 66 72 6f 6d 20 3c 73 65 65 20 63 72 65 66 3d 22 63 75 72 72 65 6e 74 53 74 61 74 trol.from.<see.cref="currentStat
af80 65 50 74 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6e 64 20 74 68 65 6e 20 61 64 ePtr"/>..........///.and.then.ad
afa0 64 73 20 69 74 20 74 6f 20 74 68 65 20 76 61 6c 75 65 20 6f 66 20 74 68 65 20 63 6f 6e 74 72 6f ds.it.to.the.value.of.the.contro
afc0 6c 20 66 6f 75 6e 64 20 69 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6e 65 77 53 74 l.found.in.<paramref.name="newSt
afe0 61 74 65 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f ate"/>...........///..........//
b000 2f 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 20 6d 65 74 68 6f 64 20 64 6f 65 73 20 6e 6f 74 68 /.Note.that.the.method.does.noth
b020 69 6e 67 20 69 66 20 61 20 76 61 6c 75 65 20 66 6f 72 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 69 ing.if.a.value.for.the.control.i
b040 73 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 65 64 20 69 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d s.not.contained.in.<paramref.nam
b060 65 3d 22 6e 65 77 53 74 61 74 65 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 e="newState"/>...........///.Thi
b080 73 20 63 61 6e 20 62 65 20 74 68 65 20 63 61 73 65 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c 20 s.can.be.the.case,.for.example,.
b0a0 66 6f 72 20 3c 73 65 65 20 63 72 65 66 3d 22 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 22 2f for.<see.cref="DeltaStateEvent"/
b0c0 3e 73 2e 0d 0a 20 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 >s...........///.</remarks>.....
b0e0 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 50 6f 69 6e 74 65 72 2e .....///.<seealso.cref="Pointer.
b100 64 65 6c 74 61 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 delta"/>..........public.static.
b120 75 6e 73 61 66 65 20 76 6f 69 64 20 41 63 63 75 6d 75 6c 61 74 65 56 61 6c 75 65 49 6e 45 76 65 unsafe.void.AccumulateValueInEve
b140 6e 74 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3c 66 6c 6f 61 74 3e 20 63 6f 6e 74 nt(this.InputControl<float>.cont
b160 72 6f 6c 2c 20 76 6f 69 64 2a 20 63 75 72 72 65 6e 74 53 74 61 74 65 50 74 72 2c 20 49 6e 70 75 rol,.void*.currentStatePtr,.Inpu
b180 74 45 76 65 6e 74 50 74 72 20 6e 65 77 53 74 61 74 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a tEventPtr.newState)..........{..
b1a0 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 20 6e 75 6c 6c 29 ............if.(control.==.null)
b1c0 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 41 72 67 75 ..................throw.new.Argu
b1e0 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 6f 6e 74 72 6f 6c mentNullException(nameof(control
b200 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 63 6f 6e 74 72 6f 6c 2e ));................if.(!control.
b220 52 65 61 64 55 6e 70 72 6f 63 65 73 73 65 64 56 61 6c 75 65 46 72 6f 6d 45 76 65 6e 74 28 6e 65 ReadUnprocessedValueFromEvent(ne
b240 77 53 74 61 74 65 2c 20 6f 75 74 20 76 61 72 20 6e 65 77 44 65 6c 74 61 29 29 0d 0a 20 20 20 20 wState,.out.var.newDelta))......
b260 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 20 2f 2f 20 56 61 6c 75 65 20 66 6f 72 ............return;.//.Value.for
b280 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 65 64 20 69 6e 20 74 68 .the.control.not.contained.in.th
b2a0 65 20 67 69 76 65 6e 20 65 76 65 6e 74 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 e.given.event.................va
b2c0 72 20 6f 6c 64 44 65 6c 74 61 20 3d 20 63 6f 6e 74 72 6f 6c 2e 52 65 61 64 55 6e 70 72 6f 63 65 r.oldDelta.=.control.ReadUnproce
b2e0 73 73 65 64 56 61 6c 75 65 46 72 6f 6d 53 74 61 74 65 28 63 75 72 72 65 6e 74 53 74 61 74 65 50 ssedValueFromState(currentStateP
b300 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f 6c 2e 57 72 69 74 65 56 tr);..............control.WriteV
b320 61 6c 75 65 49 6e 74 6f 45 76 65 6e 74 28 6f 6c 64 44 65 6c 74 61 20 2b 20 6e 65 77 44 65 6c 74 alueIntoEvent(oldDelta.+.newDelt
b340 61 2c 20 6e 65 77 53 74 61 74 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 a,.newState);..........}........
b360 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 46 69 6e 64 43 6f 6e 74 72 ....public.static.void.FindContr
b380 6f 6c 73 52 65 63 75 72 73 69 76 65 3c 54 43 6f 6e 74 72 6f 6c 3e 28 74 68 69 73 20 49 6e 70 75 olsRecursive<TControl>(this.Inpu
b3a0 74 43 6f 6e 74 72 6f 6c 20 70 61 72 65 6e 74 2c 20 49 4c 69 73 74 3c 54 43 6f 6e 74 72 6f 6c 3e tControl.parent,.IList<TControl>
b3c0 20 63 6f 6e 74 72 6f 6c 73 2c 20 46 75 6e 63 3c 54 43 6f 6e 74 72 6f 6c 2c 20 62 6f 6f 6c 3e 20 .controls,.Func<TControl,.bool>.
b3e0 70 72 65 64 69 63 61 74 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 54 43 predicate)..............where.TC
b400 6f 6e 74 72 6f 6c 20 3a 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 0d 0a 20 20 20 20 20 20 20 20 7b ontrol.:.InputControl..........{
b420 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 61 72 65 6e 74 20 3d 3d 20 6e 75 6c 6c ..............if.(parent.==.null
b440 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 41 72 67 )..................throw.new.Arg
b460 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 70 61 72 65 6e 74 umentNullException(nameof(parent
b480 29 29 3b 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 73 20 3d 3d ));..............if.(controls.==
b4a0 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
b4c0 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
b4e0 6f 6e 74 72 6f 6c 73 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 70 72 65 64 ontrols));..............if.(pred
b500 69 63 61 74 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 icate.==.null)..................
b520 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 throw.new.ArgumentNullException(
b540 6e 61 6d 65 6f 66 28 70 72 65 64 69 63 61 74 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 nameof(predicate));.............
b560 20 69 66 20 28 70 61 72 65 6e 74 20 69 73 20 54 43 6f 6e 74 72 6f 6c 20 70 61 72 65 6e 74 41 73 .if.(parent.is.TControl.parentAs
b580 54 43 6f 6e 74 72 6f 6c 20 26 26 20 70 72 65 64 69 63 61 74 65 28 70 61 72 65 6e 74 41 73 54 43 TControl.&&.predicate(parentAsTC
b5a0 6f 6e 74 72 6f 6c 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 72 6f ontrol))..................contro
b5c0 6c 73 2e 41 64 64 28 70 61 72 65 6e 74 41 73 54 43 6f 6e 74 72 6f 6c 29 3b 0d 0a 0d 0a 20 20 20 ls.Add(parentAsTControl);.......
b5e0 20 20 20 20 20 20 20 20 20 76 61 72 20 63 68 69 6c 64 72 65 6e 20 3d 20 70 61 72 65 6e 74 2e 63 .........var.children.=.parent.c
b600 68 69 6c 64 72 65 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 68 69 6c 64 43 hildren;..............var.childC
b620 6f 75 6e 74 20 3d 20 63 68 69 6c 64 72 65 6e 2e 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 ount.=.children.Count;..........
b640 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 63 68 69 6c 64 43 6f 75 ....for.(var.i.=.0;.i.<.childCou
b660 6e 74 3b 20 2b 2b 69 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 nt;.++i)..............{.........
b680 20 20 20 20 20 20 20 20 20 76 61 72 20 63 68 69 6c 64 20 3d 20 70 61 72 65 6e 74 2e 63 68 69 6c .........var.child.=.parent.chil
b6a0 64 72 65 6e 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46 69 6e 64 43 6f dren[i];..................FindCo
b6c0 6e 74 72 6f 6c 73 52 65 63 75 72 73 69 76 65 28 63 68 69 6c 64 2c 20 63 6f 6e 74 72 6f 6c 73 2c ntrolsRecursive(child,.controls,
b6e0 20 70 72 65 64 69 63 61 74 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 .predicate);..............}.....
b700 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 73 74 61 74 69 .....}............internal.stati
b720 63 20 73 74 72 69 6e 67 20 42 75 69 6c 64 50 61 74 68 28 74 68 69 73 20 49 6e 70 75 74 43 6f 6e c.string.BuildPath(this.InputCon
b740 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 2c 20 73 74 72 69 6e 67 20 64 65 76 69 63 65 4c 61 79 6f 75 trol.control,.string.deviceLayou
b760 74 2c 20 53 74 72 69 6e 67 42 75 69 6c 64 65 72 20 62 75 69 6c 64 65 72 20 3d 20 6e 75 6c 6c 29 t,.StringBuilder.builder.=.null)
b780 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 20 28 63 6f 6e ..........{..............if.(con
b7a0 74 72 6f 6c 20 3d 3d 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 trol.==.null)..................t
b7c0 68 72 6f 77 20 6e 65 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 hrow.new.ArgumentNullException(n
b7e0 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 20 69 66 ameof(control));..............if
b800 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 64 65 76 69 63 65 4c 61 79 .(string.IsNullOrEmpty(deviceLay
b820 6f 75 74 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 out))..................throw.new
b840 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 64 65 .ArgumentNullException(nameof(de
b860 76 69 63 65 4c 61 79 6f 75 74 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 viceLayout));................if.
b880 28 62 75 69 6c 64 65 72 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 (builder.==.null)...............
b8a0 20 20 20 62 75 69 6c 64 65 72 20 3d 20 6e 65 77 20 53 74 72 69 6e 67 42 75 69 6c 64 65 72 28 29 ...builder.=.new.StringBuilder()
b8c0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 20 3d 20 63 6f ;................var.device.=.co
b8e0 6e 74 72 6f 6c 2e 64 65 76 69 63 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 62 75 69 ntrol.device;................bui
b900 6c 64 65 72 2e 41 70 70 65 6e 64 28 27 3c 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 62 lder.Append('<');..............b
b920 75 69 6c 64 65 72 2e 41 70 70 65 6e 64 28 64 65 76 69 63 65 4c 61 79 6f 75 74 29 3b 0d 0a 20 20 uilder.Append(deviceLayout);....
b940 20 20 20 20 20 20 20 20 20 20 62 75 69 6c 64 65 72 2e 41 70 70 65 6e 64 28 27 3e 27 29 3b 0d 0a ..........builder.Append('>');..
b960 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 64 20 75 73 61 67 65 73 20 6f 66 20 64 ..............//.Add.usages.of.d
b980 65 76 69 63 65 2c 20 69 66 20 61 6e 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 evice,.if.any...............var.
b9a0 64 65 76 69 63 65 55 73 61 67 65 73 20 3d 20 64 65 76 69 63 65 2e 75 73 61 67 65 73 3b 0d 0a 20 deviceUsages.=.device.usages;...
b9c0 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 64 ...........for.(var.i.=.0;.i.<.d
b9e0 65 76 69 63 65 55 73 61 67 65 73 2e 43 6f 75 6e 74 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 eviceUsages.Count;.++i).........
ba00 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 75 69 6c 64 65 72 2e .....{..................builder.
ba20 41 70 70 65 6e 64 28 27 7b 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 75 Append('{');..................bu
ba40 69 6c 64 65 72 2e 41 70 70 65 6e 64 28 64 65 76 69 63 65 55 73 61 67 65 73 5b 69 5d 29 3b 0d 0a ilder.Append(deviceUsages[i]);..
ba60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 75 69 6c 64 65 72 2e 41 70 70 65 6e 64 28 27 ................builder.Append('
ba80 7d 27 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 20 }');..............}.............
baa0 20 20 20 62 75 69 6c 64 65 72 2e 41 70 70 65 6e 64 28 27 2f 27 29 3b 0d 0a 0d 0a 20 20 20 20 20 ...builder.Append('/');.........
bac0 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 50 61 74 68 20 3d 20 64 65 76 69 63 65 2e 70 .......var.devicePath.=.device.p
bae0 61 74 68 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 50 61 74 ath;..............var.controlPat
bb00 68 20 3d 20 63 6f 6e 74 72 6f 6c 2e 70 61 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 62 h.=.control.path;..............b
bb20 75 69 6c 64 65 72 2e 41 70 70 65 6e 64 28 63 6f 6e 74 72 6f 6c 50 61 74 68 2c 20 64 65 76 69 63 uilder.Append(controlPath,.devic
bb40 65 50 61 74 68 2e 4c 65 6e 67 74 68 20 2b 20 31 2c 20 63 6f 6e 74 72 6f 6c 50 61 74 68 2e 4c 65 ePath.Length.+.1,.controlPath.Le
bb60 6e 67 74 68 20 2d 20 64 65 76 69 63 65 50 61 74 68 2e 4c 65 6e 67 74 68 20 2d 20 31 29 3b 0d 0a ngth.-.devicePath.Length.-.1);..
bb80 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 62 75 69 6c 64 65 72 2e 54 6f 53 ..............return.builder.ToS
bba0 74 72 69 6e 67 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 7d 0d 0a 00 tring();..........}......}..}...
bbc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 00 00 00 49 6e 70 75 74 43 6f 6e ........................InputCon
bbe0 74 72 6f 6c 45 78 74 65 6e 73 69 6f 6e 73 00 00 17 00 00 00 55 6e 69 74 79 45 6e 67 69 6e 65 2e trolExtensions......UnityEngine.
bc00 49 6e 70 75 74 53 79 73 74 65 6d 00 InputSystem.