/// <summary> /// Ejecuta una acción /// </summary> /// <param name="mesa"></param> /// <param name="tablero"></param> public void Execute(Mesa mesa, Tablero tablero) { var e = new EventHelper(tablero, mesa); var expression = this.Action + "return e?.Tablero;"; var tbl = (Tablero)e.ExecuteAction(expression, null); tablero = tbl ?? tablero; }
/// <summary> /// Ejecuta una acción de una carta del lado servidor /// </summary> public CardActionResult ExecuteServer(Mesa mesa, Tablero tablero, DataStr data) { var e = new Events.EventHelper(tablero, mesa); var expression = "var result = new YerbaSoft.Web.Games.Clue.Common.DTO.Clue.Card.CardAction.CardActionResult(tablero, true);" + this.Server + "return result;"; var result = (CardActionResult)e.ExecuteAction(expression, data); tablero = result?.Tablero ?? tablero; return(result); }