private void PlayCard(MatchData match, PlayCardCommandData commandData) { if (commandData.cardInstance.TryGetStrongType <Monster>(out CardInstance <Monster> monster)) { match.SpawnMonster(monster, commandData.targetTile, commandData.sender); } }
public override void OnExecute(GameManager gm, ICommand command) { PlayCardCommandData data = command.GetData <PlayCardCommandData>(); if (data == null) { return; } if (data.cardInstance.TryGetStrongType <Monster>(out CardInstance <Monster> monster)) { gm.match.SpawnMonster(monster, data.targetTile, data.sender); } }