Пример #1
0
        public void ProvideValue_WithPreserveCurrency_CurrencyTakenOverForResult()
        {
            myLhsSeries = new FigureSeries(typeof(FakeCurrencyFigure), FigureFactory.New(2015, 5, Euro), FigureFactory.New(2014, 7, Euro));
            myRhsSeries = new FigureSeries(typeof(FakeCurrencyFigure), FigureFactory.New(2015, 23, Euro), FigureFactory.New(2014, 37, Euro));

            var result = ( IFigureSeries )myProvider.ProvideValue(myContext.Object);

            Assert.That(result.Currency, Is.EqualTo(Euro));
        }
Пример #2
0
        public void RotateFigure()
        {
            //SUT:
            // Game:
            //   - field
            //   - figure
            // Game.RotateACW

            var game = new Game(new NextFigureFactoryStub());

            Tile TileF() => new Tile("Brown");

            game.Field = new Field(new Tile[, ]
            {
                // 0 -> Y
                // |
                // v X
                { TileF(), TileF(), TileF(), TileF(), TileF(), TileF(), TileF(), TileF(), },
                { null, null, null, null, null, null, null, TileF(), },
                { null, null, null, null, null, null, null, TileF(), },
                { null, null, null, null, null, null, null, TileF(), },
                { null, null, null, null, null, null, null, TileF(), },
                { null, null, null, null, null, null, null, TileF(), },
                { null, null, null, null, null, null, null, TileF(), },
                { null, null, null, null, null, null, null, TileF(), },
                { null, null, null, null, null, null, null, TileF(), },
                { TileF(), TileF(), TileF(), TileF(), TileF(), TileF(), TileF(), TileF(), },
            }, 1, 1
                                   );

            var figureFactory = new FigureFactory();

            var figure = figureFactory.CreateStandardFigure(FigureType.I);

            var notRotatedFigure = new Figure(figure);

            game.ResetFigure(figure).Should().BeTrue();

            game.Figure.Should().BeEquivalentTo(notRotatedFigure);

            game.RotateAntiClockWise();

            game.Figure.Should().NotBeEquivalentTo(notRotatedFigure);

            game.MoveLeft();
            game.RotateAntiClockWise();
            game.MoveLeft();
            game.RotateAntiClockWise();
            game.MoveLeft();
            game.RotateAntiClockWise();
            game.MoveLeft();
            game.RotateAntiClockWise();
            game.MoveLeft();
            game.RotateAntiClockWise();
            game.MoveLeft();

            // now the figure is at the most left
            // the wall should not let it rotate

            var figureAtLeftWallCopy = new Figure(game.Figure);

            game.RotateAntiClockWise();

            game.Figure.Should().BeEquivalentTo(figureAtLeftWallCopy);
        }
Пример #3
0
 public Figure(FigureFactory factory)
 {
     circle = factory.CreateCircle();
     square = factory.CreateSquare();
 }
        public void ProvideValue_WhenCalled_InputsReferenced()
        {
            myCurrentPrice = FigureFactory.NewPrice("2015-01-01", 17.21, Euro);
            myRhsSeries    = new FigureSeries(typeof(FakeCurrencyFigure), FigureFactory.New(2015, 23, Euro), FigureFactory.New(2014, 37, Euro));

            var result = ( DerivedFigure )myProvider.ProvideValue(myContext.Object);

            Assert.That(result.Inputs, Is.EquivalentTo(new[] { myCurrentPrice, myRhsSeries.ElementAt(1) }));
        }
        public void ProvideValue_SeriesWithoutCurrency_CurrencyOfPriceTaken()
        {
            myCurrentPrice = FigureFactory.NewPrice("2015-01-01", 17.21, Euro);
            myRhsSeries    = new FigureSeries(typeof(FakeFigure), FigureFactory.New(2015, 23), FigureFactory.New(2014, 37));

            var result = ( DerivedFigure )myProvider.ProvideValue(myContext.Object);

            Assert.That(result.Currency, Is.EqualTo(myCurrentPrice.Currency));
            Assert.That(result.Value, Is.EqualTo(17.21 + 23));
        }
Пример #6
0
        public void ProvideValue_RhsHasNoDataForPeriod_ItemSkippedInJoin()
        {
            myLhsSeries = new FigureSeries(typeof(FakeFigure), FigureFactory.New(2015, 5), FigureFactory.New(2014, 7), FigureFactory.New(2013, 87));
            myRhsSeries = new FigureSeries(typeof(FakeFigure), FigureFactory.New(2015, 23), FigureFactory.New(2014, 37));

            var result = ( IFigureSeries )myProvider.ProvideValue(myContext.Object);

            Assert.That(result.Count, Is.EqualTo(2));
        }
Пример #7
0
        /// <summary>
        /// Method Read
        /// </summary>
        /// <returns>New List</returns>
        public List <IFigure> Read(string input)
        {
            List <IFigure> boxxml  = new List <IFigure>();
            XmlReader      xreader = XmlReader.Create(input);
            Material       material;
            Colors         color   = 0;
            FigureFactory  factory = new FigureFactory();

            while (xreader.Read())
            {
                if (xreader.Name == "figure")
                {
                    switch (xreader.GetAttribute("type"))
                    {
                    case "Circle":
                    {
                        float d;
                        xreader.Read();
                        xreader.Read();
                        if (xreader.Name == "material")
                        {
                            material = (Material)Enum.Parse(typeof(Material), xreader.ReadInnerXml());
                            xreader.Read();
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        if (xreader.Name == "color")
                        {
                            if (material == Material.Paper)
                            {
                                color = (Colors)Enum.Parse(typeof(Colors), xreader.ReadInnerXml());
                                xreader.Read();
                            }
                            else
                            {
                                xreader.ReadInnerXml();
                                xreader.Read();
                            }
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        if (xreader.Name == "diameter")
                        {
                            d = float.Parse(xreader.ReadInnerXml());
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        IFigure figure = factory.CreateFigure(material, Form.Circle, new float[] { d });
                        if (material == Material.Paper && color != Colors.white)
                        {
                            ((IPaper)figure).Color = color;
                        }
                        boxxml.Add(figure);
                        break;
                    }

                    case "Square":
                    {
                        float a;
                        xreader.Read();
                        xreader.Read();
                        if (xreader.Name == "material")
                        {
                            material = (Material)Enum.Parse(typeof(Material), xreader.ReadInnerXml());
                            xreader.Read();
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        if (xreader.Name == "color")
                        {
                            if (material == Material.Paper)
                            {
                                color = (Colors)Enum.Parse(typeof(Colors), xreader.ReadInnerXml());
                                xreader.Read();
                            }
                            else
                            {
                                xreader.ReadInnerXml();
                                xreader.Read();
                            }
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        if (xreader.Name == "height")
                        {
                            a = float.Parse(xreader.ReadInnerXml());
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        IFigure figure = factory.CreateFigure(material, Form.Square, new float[] { a });
                        if (material == Material.Paper && color != Colors.white)
                        {
                            ((IPaper)figure).Color = color;
                        }
                        boxxml.Add(figure);
                        break;
                    }

                    case "Rectangle":
                    {
                        float h, w;
                        xreader.Read();
                        xreader.Read();
                        if (xreader.Name == "material")
                        {
                            material = (Material)Enum.Parse(typeof(Material), xreader.ReadInnerXml());
                            xreader.Read();
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        if (xreader.Name == "color")
                        {
                            if (material == Material.Paper)
                            {
                                color = (Colors)Enum.Parse(typeof(Colors), xreader.ReadInnerXml());
                                xreader.Read();
                            }
                            else
                            {
                                xreader.ReadInnerXml();
                                xreader.Read();
                            }
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        if (xreader.Name == "height")
                        {
                            h = float.Parse(xreader.ReadInnerXml());
                            xreader.Read();
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        if (xreader.Name == "width")
                        {
                            w = float.Parse(xreader.ReadInnerXml());
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        IFigure figure = factory.CreateFigure(material, Form.Rectangle, new float[] { h, w });
                        if (material == Material.Paper && color != Colors.white)
                        {
                            ((IPaper)figure).Color = color;
                        }
                        boxxml.Add(figure);
                        break;
                    }

                    case "Triangle":
                    {
                        float a, b, c;
                        xreader.Read();
                        xreader.Read();
                        if (xreader.Name == "material")
                        {
                            material = (Material)Enum.Parse(typeof(Material), xreader.ReadInnerXml());
                            xreader.Read();
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        if (xreader.Name == "color")
                        {
                            if (material == Material.Paper)
                            {
                                color = (Colors)Enum.Parse(typeof(Colors), xreader.ReadInnerXml());
                                xreader.Read();
                            }
                            else
                            {
                                xreader.ReadInnerXml();
                                xreader.Read();
                            }
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        if (xreader.Name == "side_a")
                        {
                            a = float.Parse(xreader.ReadInnerXml());
                            xreader.Read();
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        if (xreader.Name == "side_b")
                        {
                            b = float.Parse(xreader.ReadInnerXml());
                            xreader.Read();
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        if (xreader.Name == "side_c")
                        {
                            c = float.Parse(xreader.ReadInnerXml());
                        }
                        else
                        {
                            throw new Exception("Wrong input xml");
                        }
                        IFigure figure = factory.CreateFigure(material, Form.Triangle, new float[] { a, b, c });
                        if (material == Material.Paper && color != Colors.white)
                        {
                            ((IPaper)figure).Color = color;
                        }
                        boxxml.Add(figure);
                        break;
                    }
                    }
                }
            }
            xreader.Close();
            return(boxxml);
        }
Пример #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            IDrawAPI circle = FigureFactory.GetFigure("Circle");

            circle.GetFigure(GetRandom(200), GetRandom(200), GetRandom(200), PictureBox);
        }
Пример #9
0
        private void button2_Click(object sender, EventArgs e)
        {
            IDrawAPI rectangle = FigureFactory.GetFigure("Rectangle");

            rectangle.GetFigure(GetRandom(200), GetRandom(200), GetRandom(200), GetRandom(200), PictureBox);
        }
Пример #10
0
 public Figure generateFigure()
 {
     return(FigureFactory.createCharacter(name, team));
 }
Пример #11
0
 //Method for adding basic figure
 public void AddFigure(string figureType, int startPositionX, int startPositionY, int finalyPositionX, int finalyPositionY)
 {
     _figure = FigureFactory.Get(figureType);
     AddFigureToField(_figure, new Position(startPositionX, startPositionY));
     _finalPositions = new Position(finalyPositionX, finalyPositionY);
 }
Пример #12
0
 public FigureFactoryTest()
 {
     _figureFactoryfactory = new FigureFactory();
 }
Пример #13
0
 public TriangleTest()
 {
     _figureFactoryfactory = new FigureFactory();
 }
Пример #14
0
 public void SetUp()
 {
     _factory = new FigureFactory();
     _calc    = new AreaCalculator();
 }
Пример #15
0
        public void ProvideValue_WhenCalled_InputsReferenced()
        {
            myLhsSeries = new FigureSeries(typeof(FakeCurrencyFigure), FigureFactory.New(2015, 5, Euro), FigureFactory.New(2014, 7, Euro));
            myRhsSeries = new FigureSeries(typeof(FakeCurrencyFigure), FigureFactory.New(2015, 23, Euro), FigureFactory.New(2014, 37, Euro));

            var result = ( IFigureSeries )myProvider.ProvideValue(myContext.Object);

            Assert.That((( DerivedFigure )result.ElementAt(0)).Inputs, Is.EquivalentTo(new[] { myLhsSeries.ElementAt(0), myRhsSeries.ElementAt(0) }));
            Assert.That((( DerivedFigure )result.ElementAt(1)).Inputs, Is.EquivalentTo(new[] { myLhsSeries.ElementAt(1), myRhsSeries.ElementAt(1) }));
        }
Пример #16
0
 public Loader(Store _store, FigureFactory _figureFactory)
 {
     this.store    = _store;
     figureFactory = _figureFactory;
 }
Пример #17
0
        public void ProvideValue_InconsistentCurrencies_Throws()
        {
            myLhsSeries = new FigureSeries(typeof(FakeCurrencyFigure), FigureFactory.New(2015, 5, Euro), FigureFactory.New(2014, 7, Euro));
            myRhsSeries = new FigureSeries(typeof(FakeCurrencyFigure), FigureFactory.New(2015, 23, Dollar), FigureFactory.New(2014, 37, Dollar));

            var ex = Assert.Throws <ArgumentException>(() => myProvider.ProvideValue(myContext.Object));

            Assert.That(ex.Message, Does.Contain("Currency inconsistencies"));
        }
Пример #18
0
        private bool ValidateMove(Figure figure, int toRow, int toCol)
        {
            PositionModel toPosition = new PositionModel()
            {
                Row = toRow, Col = toCol
            };
            PositionModel fromPosition = new PositionModel()
            {
                Row = figure.PositionRow, Col = figure.PositionCol
            };

            if (toRow > 8 || toCol > 8)
            {
                return(false);
            }

            if (toRow < 0 || toCol < 0)
            {
                return(false);
            }

            var currentFigure = FigureFactory.GetFigure(figure);

            List <PositionModel> possibleMoves = currentFigure.GetPossibleMoves();
            List <PositionModel> possibleHits  = currentFigure.GetPossibleHits();

            var checkedPosMoves = possibleMoves.Find(x => x.Col == toPosition.Col && x.Row == toPosition.Row);
            var checkedPosHits  = possibleHits.Find(x => x.Col == toPosition.Col && x.Row == toPosition.Row);

            if (checkedPosMoves == null && checkedPosHits == null)
            {
                return(false);
            }


            if (!currentFigure.CanJump())
            {
                FigureRepository figureRepository = data.GetFigureRepository();

                HashSet <PositionModel> movePath       = GetMovePath(fromPosition, toPosition);
                IQueryable <Figure>     allGameFigures = figureRepository.GetGameFigures(figure.GameId);

                HashSet <PositionModel> gameFiguresPositions = new HashSet <PositionModel>();
                foreach (Figure gameFig in allGameFigures)
                {
                    gameFiguresPositions.Add(new PositionModel()
                    {
                        Row = gameFig.PositionRow,
                        Col = gameFig.PositionCol
                    });
                }

                var positionIntersection = movePath.Intersect <PositionModel>(gameFiguresPositions);

                if (positionIntersection.Count() > 0)
                {
                    return(false);
                }
            }

            return(true);
        }
Пример #19
0
        public void ProvideValue_WithValidInputData_JoinReturned()
        {
            myLhsSeries = new FigureSeries(typeof(FakeFigure), FigureFactory.New(2015, 5), FigureFactory.New(2014, 7));
            myRhsSeries = new FigureSeries(typeof(FakeFigure), FigureFactory.New(2015, 23), FigureFactory.New(2014, 37));

            var result = ( IFigureSeries )myProvider.ProvideValue(myContext.Object);

            var r2015 = result.Single(i => i.Period.Equals(new YearPeriod(2015)));

            Assert.That(r2015.Value, Is.EqualTo(28));

            var r2014 = result.Single(i => i.Period.Equals(new YearPeriod(2014)));

            Assert.That(r2014.Value, Is.EqualTo(44));
        }
Пример #20
0
 public FigureAreaComputeTest()
 {
     _fixture = new Fixture();
     _fixture.Customizations.Add(new RandomRangedNumberGenerator());
     _figureFactoryfactory = new FigureFactory();
 }
        public void ProvideValue_WithValidInputData_RatioReturned()
        {
            myCurrentPrice = FigureFactory.NewPrice("2015-01-01", 17.21, Euro);
            myRhsSeries    = new FigureSeries(typeof(FakeCurrencyFigure), FigureFactory.New(2015, 23, Euro), FigureFactory.New(2014, 37, Euro));

            var result = ( ICurrencyFigure )myProvider.ProvideValue(myContext.Object);

            Assert.That(result.Period, Is.EqualTo(myCurrentPrice.Period));
            Assert.That(result.Value, Is.EqualTo(17.21 + 23));
            Assert.That(result.Currency, Is.EqualTo(myCurrentPrice.Currency));
        }
Пример #22
0
        /// <summary>
        /// StreamReader
        /// </summary>
        /// <returns>List of figures from XML</returns>
        public List <IFigure> Read(string input)
        {
            FigureFactory  factory = new FigureFactory();
            List <IFigure> boxxml  = new List <IFigure>();
            StreamReader   sr      = new StreamReader(input);
            string         doc     = sr.ReadToEnd();
            XmlDocument    xdoc    = new XmlDocument();

            xdoc.LoadXml(doc);
            XmlElement xRoot = xdoc.DocumentElement;

            foreach (XmlNode xnode in xRoot)
            {
                XmlNode typefigure = xnode.Attributes.GetNamedItem("type");
                switch (typefigure.Value)
                {
                case "Circle":
                {
                    Material material = 0;
                    Colors   color    = 0;
                    float    diameter = 1;
                    foreach (XmlNode childnode in xnode.ChildNodes)
                    {
                        if (childnode.Name == "material")
                        {
                            material = (Material)Enum.Parse(typeof(Material), $"{childnode.InnerText}");
                        }
                        if (material == Material.Paper)
                        {
                            if (childnode.Name == "color")
                            {
                                color = (Colors)Enum.Parse(typeof(Colors), $"{childnode.InnerText}");
                            }
                        }
                        if (childnode.Name == "diameter")
                        {
                            diameter = float.Parse(childnode.InnerText);
                        }
                    }
                    IFigure figure = factory.CreateFigure(material, Form.Circle, diameter);
                    if (material == Material.Paper && color != Colors.white)
                    {
                        ((IPaper)figure).Color = color;
                    }
                    boxxml.Add(figure);
                    break;
                }

                case "Rectangle":
                {
                    Material material = 0;
                    Colors   color    = 0;
                    float    height   = 1;
                    float    width    = 1;
                    foreach (XmlNode childnode in xnode.ChildNodes)
                    {
                        if (childnode.Name == "material")
                        {
                            material = (Material)Enum.Parse(typeof(Material), $"{childnode.InnerText}");
                        }
                        if (material == Material.Paper)
                        {
                            if (childnode.Name == "color")
                            {
                                color = (Colors)Enum.Parse(typeof(Colors), $"{childnode.InnerText}");
                            }
                        }
                        if (childnode.Name == "height")
                        {
                            height = float.Parse(childnode.InnerText);
                        }
                        if (childnode.Name == "width")
                        {
                            width = float.Parse(childnode.InnerText);
                        }
                    }
                    IFigure figure = factory.CreateFigure(material, Form.Rectangle, new float [] { height, width });
                    if (material == Material.Paper && color != Colors.white)
                    {
                        ((IPaper)figure).Color = color;
                    }
                    boxxml.Add(figure);
                    break;
                }

                case "Square":
                {
                    Material material = 0;
                    Colors   color    = 0;
                    float    height   = 1;
                    foreach (XmlNode childnode in xnode.ChildNodes)
                    {
                        if (childnode.Name == "material")
                        {
                            material = (Material)Enum.Parse(typeof(Material), $"{childnode.InnerText}");
                        }
                        if (material == Material.Paper)
                        {
                            if (childnode.Name == "color")
                            {
                                color = (Colors)Enum.Parse(typeof(Colors), $"{childnode.InnerText}");
                            }
                        }
                        if (childnode.Name == "height")
                        {
                            height = float.Parse(childnode.InnerText);
                        }
                    }
                    IFigure figure = factory.CreateFigure(material, Form.Square, new float[] { height });
                    if (material == Material.Paper && color != Colors.white)
                    {
                        ((IPaper)figure).Color = color;
                    }
                    boxxml.Add(figure);
                    break;
                }

                case "Triangle":
                {
                    Material material = 0;
                    Colors   color    = 0;
                    float    a        = 1;
                    float    b        = 1;
                    float    c        = 1;
                    foreach (XmlNode childnode in xnode.ChildNodes)
                    {
                        if (childnode.Name == "material")
                        {
                            material = (Material)Enum.Parse(typeof(Material), $"{childnode.InnerText}");
                        }
                        if (material == Material.Paper)
                        {
                            if (childnode.Name == "color")
                            {
                                color = (Colors)Enum.Parse(typeof(Colors), $"{childnode.InnerText}");
                            }
                        }
                        if (childnode.Name == "side_a")
                        {
                            a = float.Parse(childnode.InnerText);
                        }
                        if (childnode.Name == "side_b")
                        {
                            b = float.Parse(childnode.InnerText);
                        }
                        if (childnode.Name == "side_c")
                        {
                            c = float.Parse(childnode.InnerText);
                        }
                    }
                    IFigure figure = factory.CreateFigure(material, Form.Square, new float[] { a, b, c });
                    if (material == Material.Paper && color != Colors.white)
                    {
                        ((IPaper)figure).Color = color;
                    }
                    boxxml.Add(figure);
                    break;
                }
                }
            }
            sr.Close();
            return(boxxml);
        }
        public void ProvideValue_InconsistentCurrencies_PriceCurrencyTranslated()
        {
            myCurrentPrice = FigureFactory.NewPrice("2015-01-01", 17.21, Euro);
            myRhsSeries    = new FigureSeries(typeof(FakeCurrencyFigure), FigureFactory.New(2015, 23, Dollar), FigureFactory.New(2014, 37, Dollar));
            myContext.Setup(x => x.TranslateCurrency(It.IsAny <double>(), It.IsAny <Currency>(), It.IsAny <Currency>()))
            .Returns <double, Currency, Currency>((value, source, target) => value * 2);

            var result = ( DerivedFigure )myProvider.ProvideValue(myContext.Object);

            Assert.That(result.Currency, Is.EqualTo(myRhsSeries.Currency));
            Assert.That(result.Value, Is.EqualTo(17.21 * 2 + 23));
        }
Пример #24
0
        //Мышка нажата
        /// <summary>
        /// Обработчик события нажатия мышки
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (_isFigurePicked &&
                    SelectedFigures != null)
                {
                    if (IsPointOnFigure(e.Location))
                    {
                        if ((SelectedFigures != null) &&
                            SelectedFigures.ContainsKey(GetFigurePointOn(e.Location)))
                        {
                            _selectedFigure = _presenter.GetFigures()
                                              [GetFigurePointOn(e.Location)];

                            //Сохраняем предыдущее состояние
                            BeforeState?.Clear();

                            foreach (var figure in SelectedFigures)
                            {
                                if (!_presenter.GetFigures().Contains(figure))
                                {
                                    continue;
                                }
                                var index = figure.Key;
                                BeforeState?.Add(index, FigureFactory.CreateCopy(figure.Value));
                            }

                            MouseMoveDelegate -= MouseMoveSelecting;
                            MouseMoveDelegate += MouseMoveFigure;
                            MouseUpDelegate   += MouseUpFigure;

                            _offsetX = _selectedFigure.Points.GetPoints()[0].X - e.X;
                            _offsetY = _selectedFigure.Points.GetPoints()[0].Y - e.Y;
                        }
                    }
                    else if (IsPointOnMarker(e.Location, out _pickedPoint))
                    {
                        MouseMoveDelegate -= MouseMoveSelecting;
                        MouseMoveDelegate += MouseMoveMarker;
                        MouseUpDelegate   += MouseUpMarker;

                        BeforePointState?.Clear();

                        foreach (var figure in _presenter.GetFigures())
                        {
                            if (figure.Key != _pickedFigureIndex)
                            {
                                continue;
                            }
                            _oldFigureIndex = figure.Key;
                            BeforePointState?.Add(_oldFigureIndex,
                                                  FigureFactory.CreateCopy(figure.Value));
                        }

                        _offsetX = _pickedPoint.X - e.X;
                        _offsetY = _pickedPoint.Y - e.Y;
                    }
                    else
                    {
                        _isMouseDown = true;
                    }
                }
                else
                {
                    _isMouseDown = true;
                }
                _originalMouseDownPoint = e.Location;
            }
        }
Пример #25
0
    private void Start() {
		_figureFactory = this.GetComponent<FigureFactory> ();
		_tileFactory = this.GetComponent<TileFactory> ();
		_board = new PrototypeBoard (_dimensionOfBoard, _tileFactory);
        SetupPrototypeBoardFigures();
    }
Пример #26
0
 private void Awake()
 {
     Instance = this;
 }