Beispiel #1
0
    void TileOnMouseEnter(TileView tv)
    {
        if (isPlayerTurn && isMediumCardDragging && !isDisplayingConfirm)
        {
            if (map.DestinationSelected)
            {
                return;
            }

            Tile t = map.GetTileAt(tv.Location);
            map.SelectedTile         = t;
            mapView.SelectedTileView = tv;

            if (map.OriginTile != null)
            {
                Path <Tile>     path      = map.FindPath();
                List <TileView> pathViews = new List <TileView>();

                foreach (Tile tile in path)
                {
                    pathViews.Add(mapView.GetTileViewAt(tile.Location));
                }

                mapView.SetPathViews(pathViews);
                mapView.DrawSelectionPath();
            }

            //when mouse is over some tile, the tile is passable and the current tile is neither destination nor origin tile, change color to orange
            if (!IsUnitMoving() && !t.IsOnPath)
            {
                tv.ChangeColor(ORANGE);
            }
        }
    }