/// <summary> /// Create a new LockButton contained on the specified Lock, linked to the specified button. /// </summary> /// <param name="containingLock">Containing lock.</param> /// <param name="linkedButton">Linked button.</param> /// <param name="on">If set to <c>true</c> on.</param> public LockButton(Lock containingLock, int containingLockIndex, LockButton linkedButton, bool isOn) { ContainingLock = containingLock; ContainingLockIndex = containingLockIndex; LinkedButton = linkedButton; IsOn = isOn; }
/// <summary> /// Create a new lock grid of the specified dimensions, with each lock having the specified number of buttons. /// Initializes each lock as Unlinked in the 'Off' state. /// </summary> /// <param name="rowCount">Row count.</param> /// <param name="colCount">Col count.</param> /// <param name="buttonCount">Button count.</param> public LockGrid(int rowCount, int colCount, int buttonCount, int maxMovesFor2Stars, int maxMovesFor3Stars) { RowCount = rowCount; ColCount = colCount; ButtonCount = buttonCount; MaxMovesFor2Stars = maxMovesFor2Stars; MaxMovesFor3Stars = maxMovesFor3Stars; Locks = new Lock[rowCount,colCount]; for (int row=0; row<rowCount; row++) { for (int col=0; col<colCount; col++) { Locks [row, col] = new Lock (row, col, buttonCount, 0); } } }