ORKTowerOfHanoiMove Class Reference

Inherits from NSObject
Conforms to NSCopying
NSSecureCoding
Declared in ORKTowerOfHanoiResult.h

The ORKTowerOfHanoiMove class represents a single move in a Tower of Hanoi puzzle.

The Tower of Hanoi move object records the indexes of the donor and recipient towers and the time at which the event occurred. A towerOfHanoiMove instance is included in an ORKTowerOfHanoiResult object and is recorded by the step view controller for the corresponding task when a move is made.

A Tower of Hanoi move is typically generated by the framework as the task proceeds. When the task completes, it may be appropriate to serialize the move for transmission to a server, or to immediately perform analysis on it.

  timestamp

A relative timestamp indicating the time of the tap event.

@property (nonatomic, assign) NSTimeInterval timestamp

Discussion

The timestamp is relative to the value of startDate in the ORKResult object that includes this move. The start date of that object represents the time at which the first move was made.

Declared In

ORKTowerOfHanoiResult.h

  donorTowerIndex

The index of the donor tower in the move.

@property (nonatomic, assign) NSUInteger donorTowerIndex

Discussion

The Tower of Hanoi puzzle has three towers, and so the value of this property is therefore always 0, 1, or 2. The indexes sequentially represent the towers from left to right when they are laid out horizontally and from top to bottom when they are layed out vertically. The index for a given tower is consistent between changes to and from the horizontal and vertical layouts.

Declared In

ORKTowerOfHanoiResult.h

  recipientTowerIndex

The index of the recipient tower in the move.

@property (nonatomic, assign) NSUInteger recipientTowerIndex

Discussion

The Tower of Hanoi puzzle has three towers, and so the value of this property is therefore always 0, 1, or 2. The indexes sequentially represent the towers from left to right when they are laid out horizontally and from top to bottom when they are layed out vertically. The index for a given tower is consistent between changes to and from the horizontal and vertical layouts.

Declared In

ORKTowerOfHanoiResult.h