Did some cleanup

This commit is contained in:
Brady
2019-10-25 23:27:56 -06:00
parent b64540c812
commit 763bd2f4df
5 changed files with 0 additions and 127 deletions

View File

@@ -35,18 +35,6 @@
<e p="Validator.cs" t="Include" />
</e>
<e p="Shapes.sln" t="IncludeFlat" />
<e p="Temp" t="IncludeRecursive">
<e p="bin" t="ExcludeRecursive" />
<e p="obj" t="ExcludeRecursive">
<e p="Debug" t="Include">
<e p="netcoreapp2.2" t="Include">
<e p="Temp.AssemblyInfo.cs" t="Include" />
</e>
</e>
</e>
<e p="Program.cs" t="Include" />
<e p="Temp.csproj" t="IncludeRecursive" />
</e>
<e p="UnitTests" t="IncludeRecursive">
<e p="bin" t="ExcludeRecursive" />
<e p="CircleTests.cs" t="Include" />

View File

@@ -1,70 +0,0 @@
using System;
using System.Drawing;
using System.IO;
using Shapes;
using Image = Shapes.Image;
using Point = Shapes.Point;
using Rectangle = Shapes.Rectangle;
namespace Temp
{
internal class Program
{
private static void Main(string[] args)
{
var circle = new Circle(new Point(20, 20), 4);
Console.WriteLine($"({circle.CenterPoint.X}, {circle.CenterPoint.Y})");
circle.Move(5, 5);
Console.WriteLine($"({circle.CenterPoint.X}, {circle.CenterPoint.Y})");
var line = new Line(3, 4, 4, 5);
var tmp = line.ComputeLength();
var point = new Point(3, 3);
var rectangle = new Rectangle(new Point(3, 3), new Point(5, 3), new Point(5, 5), new Point(3, 5));
//var rectangle2 = new Rectangle(new Point(3,0), new Point(3,0), new Point(3,2), new Point(0,3));
Console.WriteLine(
$"({rectangle.Points[0].X}, {rectangle.Points[0].Y}), ({rectangle.Points[1].X}, {rectangle.Points[1].Y}), ({rectangle.Points[2].X}, {rectangle.Points[2].Y}), ({rectangle.Points[3].X}, {rectangle.Points[3].Y}) Height:{rectangle.CalculateHeight()} Width:{rectangle.CalculateWidth()} Center: {rectangle.CenterPoint.X}, {rectangle.CenterPoint.Y}");
// rectangle.Rotate(180);
// Console.WriteLine($"({rectangle.Points[0].X}, {rectangle.Points[0].Y}), ({rectangle.Points[1].X}, {rectangle.Points[1].Y}), ({rectangle.Points[2].X}, {rectangle.Points[2].Y}), ({rectangle.Points[3].X}, {rectangle.Points[3].Y}) Height:{rectangle.CalculateHeight()} Width:{rectangle.CalculateWidth()} Center: {rectangle.CenterPoint.X}, {rectangle.CenterPoint.Y}");
// rectangle.Rotate(180);
// Console.WriteLine($"({rectangle.Points[0].X}, {rectangle.Points[0].Y}), ({rectangle.Points[1].X}, {rectangle.Points[1].Y}), ({rectangle.Points[2].X}, {rectangle.Points[2].Y}), ({rectangle.Points[3].X}, {rectangle.Points[3].Y}) Height:{rectangle.CalculateHeight()} Width:{rectangle.CalculateWidth()} Center: {rectangle.CenterPoint.X}, {rectangle.CenterPoint.Y}");
rectangle.Move(15, 10);
// Console.WriteLine($"({rectangle.Points[50].X}, {rectangle.Points[50].Y}), ({rectangle.Points[100].X}, {rectangle.Points[50].Y}), ({rectangle.Points[100].X}, {rectangle.Points[100].Y}), ({rectangle.Points[50].X}, {rectangle.Points[100].Y}) Height:{rectangle.CalculateHeight()} Width:{rectangle.CalculateWidth()} Center: {rectangle.CenterPoint.X}, {rectangle.CenterPoint.Y}");
var triangle = new Triangle(new Point(3, 3), new Point(7, 3), new Point(7, 6));
Console.WriteLine(
$"\n \n ({triangle.Points[0].X}, {triangle.Points[0].Y}) ({triangle.Points[1].X}, {triangle.Points[1].Y}) ({triangle.Points[2].X}, {triangle.Points[2].Y}) Center: ({triangle.CenterPoint.X}, {triangle.CenterPoint.Y}) Area = {triangle.ComputeArea()} ");
triangle.Rotate(30);
Console.WriteLine(
$"({triangle.Points[0].X}, {triangle.Points[0].Y}) ({triangle.Points[1].X}, {triangle.Points[1].Y}) ({triangle.Points[2].X}, {triangle.Points[2].Y}) Center: ({triangle.CenterPoint.X}, {triangle.CenterPoint.Y}) Area = {triangle.ComputeArea()}");
var composite = new CompositeShape();
composite.Add(new Rectangle(new Point(500, 500), new Size(100, 100)));
// composite.Add(triangle);
var composite2 = new CompositeShape();
composite2.Add(composite);
var save = new FileStream(@"/Users/bradybodily/Documents/testing/testing.jpg", FileMode.Create);
composite.Draw(save);
composite2.RemoveShape(composite);
composite.RemoveAllShapes();
var wf = new FileStream(@"/Users/bradybodily/Documents/testing/test.txt", FileMode.Create);
triangle.Save(wf);
var fs = new FileStream(@"/Users/bradybodily/Documents/testing/test.txt", FileMode.Open);
var triangle2 = new ShapeFactory().GetShapeFromFile<Triangle>(fs);
Console.WriteLine(
$"({triangle2.Points[0].X}, {triangle2.Points[0].Y}) ({triangle2.Points[1].X}, {triangle2.Points[1].Y}) ({triangle2.Points[2].X}, {triangle2.Points[2].Y}) Center: ({triangle2.CenterPoint.X}, {triangle2.CenterPoint.Y}) Area = {triangle2.ComputeArea()} ");
var imf = new FileStream(@"/Users/bradybodily/Documents/testing/visual-reverse-image-search-v2_intro.jpg",
FileMode.Create);
var i = new Image(new Point(20, 20), new Size(20, 20), imf);
}
}
}

View File

@@ -1,12 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Shapes\Shapes.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,15 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="nunit" Version="3.11.0"/>
<PackageReference Include="NUnit3TestAdapter" Version="3.11.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0"/>
</ItemGroup>
</Project>

View File

@@ -1,18 +0,0 @@
using NUnit.Framework;
using Shapes;
namespace Tests
{
public class Tests
{
[SetUp]
public void Setup()
{
}
[Test]
public void Test1()
{
Assert.Pass();
}
}
}