public bool RemoveRuneFromBoard(int position, bool sendRemove = true)
{
if (!ClientManager.GetInstance()._client.IsMyTurn)
return false;
Rune rune;
bool runeFound = _runesOnBoard.TryGetValue(position, out rune);
if (runeFound)
{
if (rune.TurnUsed == ClientManager.GetInstance()._client._turnNumber)
{
Dictionary<int, Rune> tempRunesOnBoard = new Dictionary<int, Rune>(_runesOnBoard);
tempRunesOnBoard.Remove(position);
if (EverythingIsConnectedToCenter(ref tempRunesOnBoard))
{
if (_runesOnBoard.Count == 2)
SecondPlaced = -1;
_runesOnBoard.Remove(position);
_runesInHand.Add(rune.PositionInHand, rune);
rune.PositionOnBoard = -1;
ClientManager.GetInstance()._client.CurrentCharacter.CurrentActionPoints++;
if(sendRemove)
ClientManager.GetInstance()._client.SendRemoveRune();
return true;
}
else
{
Logger.Debug("Could not remove rune from " + position + " : not every runes are connected");
}
}
else
{
Logger.Debug("Could not remove rune from " + position + " : the rune was not placed on this turn");
}
}
return false;
}