コード例 #1
0
        public static Rectangle GetIconPosition(ConcretePlace place)
        {
            if (!_placesIcons.ContainsKey(place))
            {
                return(Rectangle.Empty);
            }

            return(_placesIcons[place]);
        }
コード例 #2
0
        private void BoardIconClicked(ConcretePlace concretePlace)
        {
            Console.WriteLine($"Icon clicked: {concretePlace}");

            var place = GameData.GetPlaceById((int)concretePlace);

            if (place is IHorse horse)
            {
                var underShadowDrawable = new UnderShadowDrawable(new Rectangle(_boardDrawable.GetX(),
                                                                                _boardDrawable.GetY(), _boardDrawable.GetWidth(), _boardDrawable.GetHeight()));
                var cardDrawable = new HorseCardDrawable(new Point(724 / 2, 724 / 2), horse);

                underShadowDrawable.Clicked += () =>
                {
                    _view.RemoveDrawable(underShadowDrawable);
                    _view.RemoveDrawable(cardDrawable);
                };

                _view.AddDrawable(underShadowDrawable);
                _view.AddDrawable(cardDrawable);
            }
        }
コード例 #3
0
 private void BoardPositionClicked(ConcretePlace concretePlace)
 {
     Console.WriteLine($"Place clicked: {concretePlace}");
 }
コード例 #4
0
ファイル: Horse.cs プロジェクト: TomCrow/VsadilNestihl
 protected Horse(ConcretePlace concretePlace, string name, Color color)
 {
     _concretePlace = concretePlace;
     _name          = name;
     _color         = color;
 }
コード例 #5
0
 public Place(ConcretePlace concretePlace, string name, Color color)
 {
     ConcretePlace = concretePlace;
     Name          = name;
     Color         = color;
 }