Ejemplo n.º 1
0
        private void trySave(DrawableTile tile, TileActionType type, string timeString, string xString, string yString)
        {
            float time, x, y;

            try
            {
                time = float.Parse(timeString);
                x    = float.Parse(xString);
                y    = float.Parse(yString);
            }
            catch
            {
                notifications.Push("Make sure input is correct", NotificationState.Bad);
                return;
            }

            if (time < 0 && type == TileActionType.Movement)
            {
                notifications.Push("Negative time is not allowed for selected action type", NotificationState.Bad);
                return;
            }

            var action = new TileAction
            {
                EndX = x,
                EndY = y,
                Time = time,
                Type = type,
            };

            Edited?.Invoke(tile, action);
        }
Ejemplo n.º 2
0
 public BandTileEventArgs(TileActionType actionType, Guid tileId)
 {
     ActionType = actionType;
     TileId     = tileId;
 }
 public BandTileEventArgs(TileActionType actionType, Guid tileId)
 {
     ActionType = actionType;
     TileId = tileId;
 }