-
Notifications
You must be signed in to change notification settings - Fork 42
/
GKMinMaxStrategist.xml
467 lines (465 loc) · 30.7 KB
/
GKMinMaxStrategist.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
<Type Name="GKMinMaxStrategist" FullName="GameplayKit.GKMinMaxStrategist">
<TypeSignature Language="C#" Value="public class GKMinMaxStrategist : Foundation.NSObject, GameplayKit.IGKStrategist, IDisposable" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit GKMinMaxStrategist extends Foundation.NSObject implements class GameplayKit.IGKStrategist, class ObjCRuntime.INativeObject, class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:GameplayKit.GKMinMaxStrategist" />
<TypeSignature Language="F#" Value="type GKMinMaxStrategist = class
 inherit NSObject
 interface IGKStrategist
 interface INativeObject
 interface IDisposable" />
<AssemblyInfo>
<AssemblyName>Xamarin.iOS</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>Foundation.NSObject</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>GameplayKit.IGKStrategist</InterfaceName>
</Interface>
<Interface>
<InterfaceName>ObjCRuntime.INativeObject</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>Foundation.Register("GKMinmaxStrategist", true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 11, ObjCRuntime.PlatformArchitecture.Arch64, null)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Game AI that evaluates potential game states, scores them, and attempts to maximize it's own score while minimizing it's opponents.</summary>
<remarks>
<para>The <see cref="T:GameplayKit.GKMinMaxStrategist" /> class is an implementation of the minimax algorithm, optimized for space efficiency. Developers do not subclass <see cref="T:GameplayKit.GKMinMaxStrategist" />, but instead create game-specific implementations of <see cref="T:GameplayKit.IGKGameModelPlayer" />, <see cref="T:GameplayKit.IGKGameModel" />, and <see cref="T:GameplayKit.IGKGameModelUpdate" />. This is discussed in detail in the "AI Opponent" section of the remarks section of the <format type="text/html"><a href="https://docs.microsoft.com/en-us/search/index?search=Gameplay%20Kit&scope=Xamarin" title="N:GameplayKit">N:GameplayKit</a></format> namespace documentation.</para>
<para>Perhaps because <see cref="T:GameplayKit.GKMinMaxStrategist" /> is a highly-optimized implementation, it's failure modes are difficult to debug. Typically, a mistake in the configuration of <see cref="T:GameplayKit.GKMinMaxStrategist" /> or in the implementation of the related game classes results in an <see langword="null" /> returned by <see cref="M:GameplayKit.GKMinMaxStrategist.GetBestMove(GameplayKit.IGKGameModelPlayer)" /> with no error message in the console or system log. The following sequence diagram may be of some help in placing breakpoints:</para>
<para>
<img href="~/GameplayKit/_images/GKMinMaxStrategist.GetBestMoveMove_Sequence.png" alt="Sequence diagram showing the get best move algorithm." />
</para>
<para>Because <see cref="M:GameplayKit.GKMinMaxStrategist.GetBestMove(GameplayKit.IGKGameModelPlayer)" /> is very expensive, developers should typically call it from a background <format type="text/html"><a href="https://docs.microsoft.com/en-us/search/index?search=System%20Threading%20Tasks%20Task&scope=Xamarin" title="T:System.Threading.Tasks.Task">T:System.Threading.Tasks.Task</a></format>.</para>
</remarks>
<related type="externalDocumentation" href="https://developer.apple.com/library/ios/documentation/GameplayKit/Reference/GKMinmaxStrategist_Class/index.html">Apple documentation for <c>GKMinmaxStrategist</c></related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public GKMinMaxStrategist ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:GameplayKit.GKMinMaxStrategist.#ctor" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>Foundation.Export("init")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Default constructor, initializes a new instance of this class.</summary>
<remarks />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected GKMinMaxStrategist (Foundation.NSObjectFlag t);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class Foundation.NSObjectFlag t) cil managed" />
<MemberSignature Language="DocId" Value="M:GameplayKit.GKMinMaxStrategist.#ctor(Foundation.NSObjectFlag)" />
<MemberSignature Language="F#" Value="new GameplayKit.GKMinMaxStrategist : Foundation.NSObjectFlag -> GameplayKit.GKMinMaxStrategist" Usage="new GameplayKit.GKMinMaxStrategist t" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="t" Type="Foundation.NSObjectFlag" />
</Parameters>
<Docs>
<param name="t">Unused sentinel value, pass NSObjectFlag.Empty.</param>
<summary>Constructor to call on derived classes to skip initialization and merely allocate the object.</summary>
<remarks>
<para>This constructor should be called by derived classes when they completely construct the object in managed code and merely want the runtime to allocate and initialize the NSObject. This is required to implement the two-step initialization process that Objective-C uses, the first step is to perform the object allocation, the second step is to initialize the object. When developers invoke the constructor that takes the NSObjectFlag.Empty they take advantage of a direct path that goes all the way up to NSObject to merely allocate the object's memory and bind the Objective-C and C# objects together. The actual initialization of the object is up to the developer.</para>
<para>This constructor is typically used by the binding generator to allocate the object, but prevent the actual initialization to take place. Once the allocation has taken place, the constructor has to initialize the object. With constructors generated by the binding generator this means that it manually invokes one of the "init" methods to initialize the object.</para>
<para>It is the developer's responsibility to completely initialize the object if they chain up using the NSObjectFlag.Empty path.</para>
<para>In general, if the developer's constructor invokes the NSObjectFlag.Empty base implementation, then it should be calling an Objective-C init method. If this is not the case, developers should instead chain to the proper constructor in their class. </para>
<para>The argument value is ignored and merely ensures that the only code that is executed is the construction phase is the basic NSObject allocation and runtime type registration. Typically the chaining would look like this:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
//
// The NSObjectFlag merely allocates the object and registers the
// C# class with the Objective-C runtime if necessary, but no actual
// initXxx method is invoked, that is done later in the constructor
//
// This is taken from Xamarin.iOS's source code:
//
[Export ("initWithFrame:")]
public UIView (System.Drawing.RectangleF frame) : base (NSObjectFlag.Empty)
{
// Invoke the init method now.
var initWithFrame = new Selector ("initWithFrame:").Handle;
if (IsDirectBinding)
Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSend_CGRect (this.Handle, initWithFrame, frame);
else
Handle = ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_CGRect (this.SuperHandle, initWithFrame, frame);
}
]]></code>
</example>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected internal GKMinMaxStrategist (IntPtr handle);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig specialname rtspecialname instance void .ctor(native int handle) cil managed" />
<MemberSignature Language="DocId" Value="M:GameplayKit.GKMinMaxStrategist.#ctor(System.IntPtr)" />
<MemberSignature Language="F#" Value="new GameplayKit.GKMinMaxStrategist : nativeint -> GameplayKit.GKMinMaxStrategist" Usage="new GameplayKit.GKMinMaxStrategist handle" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="handle" Type="System.IntPtr" />
</Parameters>
<Docs>
<param name="handle">Pointer (handle) to the unmanaged object.</param>
<summary>A constructor used when creating managed representations of unmanaged objects; Called by the runtime.</summary>
<remarks>
<para>This constructor is invoked by the runtime infrastructure (<see cref="M:ObjCRuntime.Runtime.GetNSObject(System.IntPtr)" />) to create a new managed representation for a pointer to an unmanaged Objective-C object. Developers should not invoke this method directly, instead they should call the GetNSObject method as it will prevent two instances of a managed object to point to the same native object.</para>
</remarks>
</Docs>
</Member>
<Member MemberName="ClassHandle">
<MemberSignature Language="C#" Value="public override IntPtr ClassHandle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance native int ClassHandle" />
<MemberSignature Language="DocId" Value="P:GameplayKit.GKMinMaxStrategist.ClassHandle" />
<MemberSignature Language="F#" Value="member this.ClassHandle : nativeint" Usage="GameplayKit.GKMinMaxStrategist.ClassHandle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IntPtr</ReturnType>
</ReturnValue>
<Docs>
<summary>The handle for this class.</summary>
<value>The pointer to the Objective-C class.</value>
<remarks>Each Xamarin.iOS class mirrors an unmanaged Objective-C class. This value contains the pointer to the Objective-C class, it is similar to calling objc_getClass with the object name.</remarks>
</Docs>
</Member>
<Member MemberName="GameModel">
<MemberSignature Language="C#" Value="public virtual GameplayKit.IGKGameModel GameModel { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class GameplayKit.IGKGameModel GameModel" />
<MemberSignature Language="DocId" Value="P:GameplayKit.GKMinMaxStrategist.GameModel" />
<MemberSignature Language="F#" Value="member this.GameModel : GameplayKit.IGKGameModel with get, set" Usage="GameplayKit.GKMinMaxStrategist.GameModel" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:GameplayKit.IGKStrategist.GameModel</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 9, 1, ObjCRuntime.PlatformArchitecture.All, null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: Foundation.Export("gameModel", ObjCRuntime.ArgumentSemantic.Strong)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>set: Foundation.Export("setGameModel:", ObjCRuntime.ArgumentSemantic.Strong)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>GameplayKit.IGKGameModel</ReturnType>
</ReturnValue>
<Docs>
<summary>The <see cref="T:GameplayKit.IGKGameModel" /> representing the current state of the game.</summary>
<value>
</value>
<remarks>
<para>Developers must set this value for <see cref="M:GameplayKit.GKMinMaxStrategist.GetBestMove(GameplayKit.IGKGameModelPlayer)" /> to return something other than <see langword="null" />.</para>
<para>Developers must not rely on this property as the only reference to their <see cref="T:GameplayKit.IGKGameModel" />. Developers must hold their own reference to the <see cref="T:GameplayKit.IGKGameModel" /> or it may be garbage collected. </para>
</remarks>
</Docs>
</Member>
<Member MemberName="GetBestMove">
<MemberSignature Language="C#" Value="public virtual GameplayKit.IGKGameModelUpdate GetBestMove (GameplayKit.IGKGameModelPlayer player);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class GameplayKit.IGKGameModelUpdate GetBestMove(class GameplayKit.IGKGameModelPlayer player) cil managed" />
<MemberSignature Language="DocId" Value="M:GameplayKit.GKMinMaxStrategist.GetBestMove(GameplayKit.IGKGameModelPlayer)" />
<MemberSignature Language="F#" Value="abstract member GetBestMove : GameplayKit.IGKGameModelPlayer -> GameplayKit.IGKGameModelUpdate
override this.GetBestMove : GameplayKit.IGKGameModelPlayer -> GameplayKit.IGKGameModelUpdate" Usage="gKMinMaxStrategist.GetBestMove player" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>Foundation.Export("bestMoveForPlayer:")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>GameplayKit.IGKGameModelUpdate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="player" Type="GameplayKit.IGKGameModelPlayer" />
</Parameters>
<Docs>
<param name="player">To be added.</param>
<summary>Calculates the <see cref="T:GameplayKit.IGKGameModelUpdate" /> that provides the greatest advantage to <paramref name="player" />, constrained by <see cref="P:GameplayKit.GKMinMaxStrategist.MaxLookAheadDepth" />.</summary>
<returns>Configuration or implementation defects may result in this method returning <see langword="null" />.</returns>
<remarks>
<para>This method returns, within the constraints of <see cref="P:GameplayKit.GKMinMaxStrategist.MaxLookAheadDepth" />, the <see cref="T:GameplayKit.IGKGameModelUpdate" /> that maximizes the expected value for <paramref name="player" /> even in the face of optimal play by the opponent.</para>
<para>This is done via a tree-search of possible game states, modeled by <see cref="T:GameplayKit.IGKGameModel" /> objects. These states are either game-ending (if either <see cref="M:GameplayKit.GKGameModel_Extensions.IsWin(GameplayKit.IGKGameModel,GameplayKit.IGKGameModelPlayer)" /> or <see cref="M:GameplayKit.GKGameModel_Extensions.IsLoss(GameplayKit.IGKGameModel,GameplayKit.IGKGameModelPlayer)" /> return <see langword="true" />) or can generate subsequent moves (see <see cref="M:GameplayKit.IGKGameModel.GetGameModelUpdates(GameplayKit.IGKGameModelPlayer)" />). The <see cref="P:GameplayKit.GKMinMaxStrategist.MaxLookAheadDepth" /> determines the number of possible moves ahead (plies) in the tree are searched.</para>
<para>The underlying algorithm's time efficiency is <c>O(b^m)</c> where <c>b</c> is the number of states in a single look-ahead "ply" and <c>m</c> is the number of plies searched (see <see cref="P:GameplayKit.GKMinMaxStrategist.MaxLookAheadDepth" />). The algorithm's space efficiency is <c>O(m)</c>.</para>
<para>If multiple <see cref="T:GameplayKit.IGKGameModelUpdate" /> objects have identical <see cref="P:GameplayKit.IGKGameModelUpdate.Value" /> values and <see cref="P:GameplayKit.GKMinMaxStrategist.RandomSource" /> is not <see langword="null" />, the <see cref="T:GameplayKit.IGKGameModelUpdate" /> returned is chosen randomly from those with maximum values. If <see cref="P:GameplayKit.GKMinMaxStrategist.RandomSource" />, this method is deterministic and returns the first move calculated with that value. (The order in which moves from a given state are calculated is the same order as that of the moves returned by <see cref="M:GameplayKit.IGKGameModel.GetGameModelUpdates(GameplayKit.IGKGameModelPlayer)" />.)</para>
<para>This method does not favor shorter outcomes to longer outcomes. For instance, if two moves both produce guaranteed wins, but one requires five rounds to guarantee the win and the other requires just one more round to win, both moves are equally valued and equally likely to be returned by <see cref="M:GameplayKit.GKMinMaxStrategist.GetBestMove(GameplayKit.IGKGameModelPlayer)" /> with a non-<see langword="null" /><see cref="P:GameplayKit.GKMinMaxStrategist.RandomSource" />.</para>
<para>Before this call returns, the internal state of the <see cref="P:GameplayKit.GKMinMaxStrategist.GameModel" /> may be changed transiently, but before this method returns, the state will be returned to it's state prior to the call. To actually apply the best move to the game, developers should call <see cref="M:GameplayKit.IGKGameModel.ApplyGameModelUpdate(GameplayKit.IGKGameModelUpdate)" />, as shown in the following:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
game = new TicTacToe ();
var strategist = new GKMinMaxStrategist {
GameModel = game,
MaxLookAheadDepth = 9,
RandomSource = new GKARC4RandomSource ()
};
while (game.IsActive ()) {
var bestMove = strategist.GetBestMove (game.GetActivePlayer()) as TicTacToeMove;
game.ApplyGameModelUpdate (bestMove);
UpdateDisplay (ticTacToe, bestMove);
Thread.Sleep (200);
}
]]></code>
</example>
<para>In the previous example, the <c>game</c> variable refers to a subtype of <see cref="T:GameplayKit.IGKGameModel" />. Note that in this case, the <see cref="T:GameplayKit.GKMinMaxStrategist" /> is playing both sides. Not shown is that this code is being run in a background <format type="text/html"><a href="https://docs.microsoft.com/en-us/search/index?search=System%20Threading%20Tasks%20Task&scope=Xamarin" title="T:System.Threading.Tasks.Task">T:System.Threading.Tasks.Task</a></format> and that application code is holding on a reference to the <c>game</c> object so that it is not garbage-collected.</para>
</remarks>
</Docs>
</Member>
<Member MemberName="GetBestMoveForActivePlayer">
<MemberSignature Language="C#" Value="public virtual GameplayKit.IGKGameModelUpdate GetBestMoveForActivePlayer ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class GameplayKit.IGKGameModelUpdate GetBestMoveForActivePlayer() cil managed" />
<MemberSignature Language="DocId" Value="M:GameplayKit.GKMinMaxStrategist.GetBestMoveForActivePlayer" />
<MemberSignature Language="F#" Value="abstract member GetBestMoveForActivePlayer : unit -> GameplayKit.IGKGameModelUpdate
override this.GetBestMoveForActivePlayer : unit -> GameplayKit.IGKGameModelUpdate" Usage="gKMinMaxStrategist.GetBestMoveForActivePlayer " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:GameplayKit.IGKStrategist.GetBestMoveForActivePlayer</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>Foundation.Export("bestMoveForActivePlayer")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 9, 1, ObjCRuntime.PlatformArchitecture.All, null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, null)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>GameplayKit.IGKGameModelUpdate</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the best possible move for the currently active player.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="GetRandomMove">
<MemberSignature Language="C#" Value="public virtual GameplayKit.IGKGameModelUpdate GetRandomMove (GameplayKit.IGKGameModelPlayer player, nint numMovesToConsider);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class GameplayKit.IGKGameModelUpdate GetRandomMove(class GameplayKit.IGKGameModelPlayer player, valuetype System.nint numMovesToConsider) cil managed" />
<MemberSignature Language="DocId" Value="M:GameplayKit.GKMinMaxStrategist.GetRandomMove(GameplayKit.IGKGameModelPlayer,System.nint)" />
<MemberSignature Language="F#" Value="abstract member GetRandomMove : GameplayKit.IGKGameModelPlayer * nint -> GameplayKit.IGKGameModelUpdate
override this.GetRandomMove : GameplayKit.IGKGameModelPlayer * nint -> GameplayKit.IGKGameModelUpdate" Usage="gKMinMaxStrategist.GetRandomMove (player, numMovesToConsider)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>Foundation.Export("randomMoveForPlayer:fromNumberOfBestMoves:")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>GameplayKit.IGKGameModelUpdate</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="player" Type="GameplayKit.IGKGameModelPlayer" />
<Parameter Name="numMovesToConsider" Type="System.nint" />
</Parameters>
<Docs>
<param name="player">To be added.</param>
<param name="numMovesToConsider">To be added.</param>
<summary>Returns a random move among the <paramref name="numMovesToConsider" /> best moves.</summary>
<returns>To be added.</returns>
<remarks>
<para>If <see cref="P:GameplayKit.GKMinMaxStrategist.RandomSource" /> is <see langword="null" />, this method returns the same move as <see cref="M:GameplayKit.GKMinMaxStrategist.GetBestMove(GameplayKit.IGKGameModelPlayer)" />.</para>
</remarks>
</Docs>
</Member>
<Member MemberName="MaxLookAheadDepth">
<MemberSignature Language="C#" Value="public virtual nint MaxLookAheadDepth { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.nint MaxLookAheadDepth" />
<MemberSignature Language="DocId" Value="P:GameplayKit.GKMinMaxStrategist.MaxLookAheadDepth" />
<MemberSignature Language="F#" Value="member this.MaxLookAheadDepth : nint with get, set" Usage="GameplayKit.GKMinMaxStrategist.MaxLookAheadDepth" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: Foundation.Export("maxLookAheadDepth", ObjCRuntime.ArgumentSemantic.UnsafeUnretained)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>set: Foundation.Export("setMaxLookAheadDepth:", ObjCRuntime.ArgumentSemantic.UnsafeUnretained)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.nint</ReturnType>
</ReturnValue>
<Docs>
<summary>The number of player turns to evaluate. Exponentially expensive.</summary>
<value>To be added.</value>
<remarks>
<para>This value determines the number of layers of plays to evaluate. A round of plays (one by each player) would be considered 2 levels: one for each player's set of possible plays.</para>
</remarks>
</Docs>
</Member>
<Member MemberName="RandomSource">
<MemberSignature Language="C#" Value="public virtual GameplayKit.IGKRandom RandomSource { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class GameplayKit.IGKRandom RandomSource" />
<MemberSignature Language="DocId" Value="P:GameplayKit.GKMinMaxStrategist.RandomSource" />
<MemberSignature Language="F#" Value="member this.RandomSource : GameplayKit.IGKRandom with get, set" Usage="GameplayKit.GKMinMaxStrategist.RandomSource" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:GameplayKit.IGKStrategist.RandomSource</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyName>Xamarin.iOS</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Xamarin.Mac</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 9, 1, ObjCRuntime.PlatformArchitecture.All, null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: Foundation.Export("randomSource", ObjCRuntime.ArgumentSemantic.Strong)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>set: Foundation.Export("setRandomSource:", ObjCRuntime.ArgumentSemantic.Strong)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>GameplayKit.IGKRandom</ReturnType>
</ReturnValue>
<Docs>
<summary>Used to break ties among moves in <see cref="M:GameplayKit.GKMinMaxStrategist.GetBestMove(GameplayKit.IGKGameModelPlayer)" /> and to choose a move in <see cref="M:GameplayKit.GKMinMaxStrategist.GetRandomMove(GameplayKit.IGKGameModelPlayer,System.nint)" />.</summary>
<value>
<para>(More documentation for this node is coming)</para>
<para tool="nullallowed">This value can be <see langword="null" />.</para>
</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>