public NanglesFigure(Pen pen, int N) { Painter = new PolygonIPainter(); Reaction = new NoReactionIReaction(); Filler = new PolygonFiller(); _anglesNumber = N; Color = pen.Color; Width = (int)pen.Width; }
public IsoscelesTriangle(Pen pen) { Painter = new PolygonIPainter(); Reaction = new NoReactionIReaction(); Filler = new PolygonFiller(); Color = pen.Color; Width = (int)pen.Width; _anglesNumber = 3; IsFilled = false; }
public Tutorial(Text tutorialText, Text tapToContinueText, GameObject countryUI, GameObject tutorialArrow, Game game) { this.tutorialText = tutorialText; this.tapToContinueText = tapToContinueText; this.countryUI = countryUI; this.tutorialArrow = tutorialArrow; this.exampleCountry = GameObject.Find("Sweden"); this.po = exampleCountry.GetComponent <PolygonFiller>(); this.camPan = Camera.main.GetComponent <CameraPan>(); this.game = game; }
public SquareFigure(Pen pen) { Painter = new PolygonIPainter(); Reaction = new NoReactionIReaction(); Filler = new PolygonFiller(); IsFilled = false; started = false; Color = pen.Color; Width = (int)pen.Width; _anglesNumber = 4; }
public void deactivateCountry() { if (currentCountryTarget == null) { return; } if (this.currentCountryTarget != null) { this.currentCountryTarget.blink = false; } currentCountryTarget.target(); currentCountryTarget.StartCoroutine(currentCountryTarget.wait()); currentCountryTarget = null; }
public void onCountrySelect() { if (game != null) { mouse.enableClicking(); currentCountryTarget = mouse.getCountry().GetComponent <PolygonFiller>(); if (!currentCountryTarget.isTargeted()) { if (mouse.getCountry().name.Equals(game.randomGenerator.getCountry().name)) { Debug.Log(game.getFailedPoints()); if (game.getFailedPoints() >= 3) { currentCountryTarget.target(currentCountryTarget.matFail); game.resetFail(); Debug.Log("FAILED"); } else { currentCountryTarget.target(); } currentCountryTarget = null; game.randomGenerator.generateNewRandomCountry(); } else { game.incrementFailedPoints(); } if (game.getFailedPoints() >= 3) { game.randomGenerator.getCountry().gameObject.GetComponent <PolygonFiller>().warning(); } } } else { circle.gameObject.SetActive(true); circle.loadCountry(this, mouse.getCountry()); currentCountryTarget = mouse.getCountry().GetComponent <PolygonFiller>(); currentCountryTarget.target(); //mouse.getCountry().GetComponent<PolygonFiller>().target(); mouse.disableClicking(); } }
private void FinalizePolygon() { Debug.WriteLine("Starting filling polygon..."); Point first = _points[0]; Point last = _points.Last(); //_graphics.DrawLine(_pen, first, last); DrawLine(_pen.Color, first.X, first.Y, last.X, last.Y); _isFinalized = true; PolygonFiller filler = new PolygonFiller(OnPointFilled); List <Edge> edges = GetEdges(); _bitmap = new Bitmap(pictureBox1.Width, pictureBox1.Height); filler.FillPolygon(edges); Debug.WriteLine("Filling finished!"); pictureBox1.Image = _bitmap; }
public PolygonViewModel() { firstInputHandler = new EditorInputHandler(firstPolygon); secondInputHandler = new CreationInputHandler(secondPolygon); firstPolygon.AddVertex(100, 100); firstPolygon.AddVertex(300, 50); firstPolygon.AddVertex(500, 280); firstPolygon.AddVertex(800, 300); firstPolygon.AddVertex(400, 500); firstPolygon.AddVertex(50, 300); secondPolygon.AddVertex(130, 80); secondPolygon.AddVertex(200, 10); secondPolygon.AddVertex(800, 600); secondPolygon.AddVertex(100, 200); firstPolygon.SetClosed(); secondPolygon.SetClosed(); firstPolygonFiller = new PolygonFiller(firstPolygon); firstPolygonFiller.SetSettings(Filling.GetFillingSettings()); }
private void FillPolygon(List <Edge> edges) { PolygonFiller filler = new PolygonFiller(OnCellFilled); filler.FillPolygon(edges); }