예제 #1
0
 public TileControl(int left, int top, int width, int height, TileViewModel tileViewModel)
 {
     myLeft = left;
     myTop = top;
     myWidth = width;
     myHeight = height;
     this.tileViewModel = tileViewModel;
     BuildHex();
     DisplayHex();
 }
예제 #2
0
 public TileControl(int left, int top, int width, int height, TileViewModel tileViewModel)
 {
     myLeft             = left;
     myTop              = top;
     myWidth            = width;
     myHeight           = height;
     this.tileViewModel = tileViewModel;
     BuildHex();
     DisplayHex();
 }
예제 #3
0
        private static Brush ConvertTileToBrush(TileViewModel tile)
        {
            switch (tile.Resource)
            {
                case Resource.Wood:
                    return new SolidColorBrush(Colors.DarkGreen);
                case Resource.Brick:
                    return new SolidColorBrush(Colors.Orange);
                case Resource.Grain:
                    return new SolidColorBrush(Colors.Yellow);
                case Resource.Ore:
                    return new SolidColorBrush(Colors.Gray);
                case Resource.Sheep:
                    return new SolidColorBrush(Colors.LightGreen);

                default:
                    return new SolidColorBrush(Colors.DarkRed);
            }
        }
예제 #4
0
        private static Brush ConvertTileToBrush(TileViewModel tile)
        {
            switch (tile.Resource)
            {
            case Resource.Wood:
                return(new SolidColorBrush(Colors.DarkGreen));

            case Resource.Brick:
                return(new SolidColorBrush(Colors.Orange));

            case Resource.Grain:
                return(new SolidColorBrush(Colors.Yellow));

            case Resource.Ore:
                return(new SolidColorBrush(Colors.Gray));

            case Resource.Sheep:
                return(new SolidColorBrush(Colors.LightGreen));

            default:
                return(new SolidColorBrush(Colors.DarkRed));
            }
        }