Exemplo n.º 1
0
    private static void FinishAcquireTargetLock(GenericShip thisShip, GenericShip targetShip, Action callback)
    {
        BlueTargetLockToken tokenBlue = new BlueTargetLockToken(thisShip);
        RedTargetLockToken  tokenRed  = new RedTargetLockToken(targetShip);

        char letter = GetFreeTargetLockLetter();

        tokenBlue.Letter          = letter;
        tokenBlue.OtherTokenOwner = targetShip;

        tokenRed.Letter          = letter;
        tokenRed.OtherTokenOwner = thisShip;

        TakeTargetLockLetter(letter);

        targetShip.Tokens.AssignToken(
            tokenRed,
            delegate
        {
            thisShip.Tokens.AssignToken(tokenBlue, delegate
            {
                thisShip.CallOnTargetLockIsAcquiredEvent(targetShip, callback);
            });
        }
            );
    }