Upravit

Sdílet prostřednictvím


IGKGameModel Interface

Definition

The current game state. Particularly useful in conjunction with GKMinMaxStrategist.

[Foundation.Protocol(Name="GKGameModel", WrapperType=typeof(GameplayKit.GKGameModelWrapper))]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 11, ObjCRuntime.PlatformArchitecture.Arch64, null)]
public interface IGKGameModel : Foundation.INSCopying, IDisposable
type IGKGameModel = interface
    interface INativeObject
    interface IDisposable
    interface INSCopying
Attributes
Implements

Remarks

When GKMinMaxStrategist is used as an AI opponent, it uses T:Gameplay.IGKGameModel objects to describe the game's state and IGKGameModelUpdate objects to describe potential moves. (See the "AI Opponent" section in the remarks at GameplayKit)

Properties

Handle

Handle (pointer) to the unmanaged object representation.

(Inherited from INativeObject)

Methods

ApplyGameModelUpdate(IGKGameModelUpdate)

Modifies the internal state of this IGKGameModel according to the move described in gameModelUpdate.

Copy(NSZone)

Performs a copy of the underlying Objective-C object.

(Inherited from INSCopying)
GetActivePlayer()

The current IGKGameModelPlayer.

GetGameModelUpdates(IGKGameModelPlayer)

The set of legal moves available to the player who's GetPlayerId(IGKGameModelPlayer) value is the same as that of player.

GetPlayers()

The IGKGameModelPlayer objects involved in the game.

SetGameModel(IGKGameModel)

Sets the internal state of the game to gameModel.

Extension Methods

GetScore(IGKGameModel, IGKGameModelPlayer)

Gets the score for the specified player.

IsLoss(IGKGameModel, IGKGameModelPlayer)

Returns a Boolean value that tells whether the player lost.

IsWin(IGKGameModel, IGKGameModelPlayer)

Returns a Boolean value that tells whether the player won.

UnapplyGameModelUpdate(IGKGameModel, IGKGameModelUpdate)

Removes the specified changes from the game's state.

Applies to