This commit is contained in:
ryuga4 2019-04-21 02:43:36 +02:00
parent a146883668
commit 1488c8f153
27 changed files with 462 additions and 230 deletions

View File

@ -41,7 +41,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="RoutePlanningEngine.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>

View File

@ -1,63 +0,0 @@
using CzokoŚmieciarka.DataModels.Enums;
using CzokoŚmieciarka.DataModels.Interfaces;
using CzokoŚmieciarka.DataModels.Interfaces.Road;
using CzokoŚmieciarka.DataModels.Interfaces.RoutePlanningEngine;
using CzokoŚmieciarka.DataModels.Interfaces.TrashCans;
using CzokoŚmieciarka.DataModels.Models;
using CzokoŚmieciarka.DataModels.Models.Steps;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Czoko_Smieciarka.AI_Naive
{
public class RoutePlanningEngine : IRoutePlanningEngine
{
IGarbageCollector Collector { get; set; }
IGarbageCollector CollectorClone { get; set; }
object[,] Board { get; set; }
object[,] BoardClone { get; set; }
public IEnumerable<IStep> ReturnSteps()
{
throw new NotImplementedException();
}
public RoutePlanningEngine(object[,] board, IGarbageCollector collector)
{
this.Collector = collector;
this.CollectorClone = (IGarbageCollector) collector.Clone();
this.Board = board;
this.BoardClone = (object [,]) board.Clone();
}
IEnumerable<IStep> PossibleSteps(object[,] BoardClone, IGarbageCollector CollectorClone)
{
var x = CollectorClone.Coords.X;
var y = CollectorClone.Coords.Y;
var maxX = BoardClone.GetLength(0) - 1;
var maxY = BoardClone.GetLength(1) - 1;
var currentCollector = CollectorClone.Clone();
var Moves = new List<IStep>
{
new MoveStep(Direction.Left, CollectorClone),
new MoveStep(Direction.Right, CollectorClone),
new MoveStep(Direction.Up, CollectorClone),
new MoveStep(Direction.Down, CollectorClone)
}
}
}
}

View File

@ -1,73 +1,3 @@
<<<<<<< HEAD
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CzokoŚmieciarka.DataModels</RootNamespace>
<AssemblyName>CzokoŚmieciarka.DataModels</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Enums\GarbageTypes.cs" />
<Compile Include="Exceptions.cs" />
<Compile Include="Enums\Directions.cs" />
<Compile Include="Interfaces\GarbageCollector\AGarbageCollector.cs" />
<Compile Include="Interfaces\GarbageCollector\IGarbageCollector.cs" />
<Compile Include="Interfaces\Garbage\AGarbage.cs" />
<Compile Include="Interfaces\Garbage\IGarbage.cs" />
<Compile Include="Interfaces\Road\IRoad.cs" />
<Compile Include="Interfaces\Road\IRoad2.cs" />
<Compile Include="Interfaces\TrashCans\ADump.cs" />
<Compile Include="Interfaces\IGarbageLocalization.cs" />
<Compile Include="Interfaces\ITypeOfGarbage.cs" />
<Compile Include="Interfaces\RoutePlanningEngine\IRoutePlanningEngine.cs" />
<Compile Include="Interfaces\TrashCans\AGarbageCollectorContainer.cs" />
<Compile Include="Interfaces\TrashCans\ATrashCan.cs" />
<Compile Include="Interfaces\IStep.cs" />
<Compile Include="Models\Coords.cs" />
<Compile Include="Models\Map.cs" />
<Compile Include="Models\Steps\CollectStep.cs" />
<Compile Include="Models\Steps\MoveStep.cs" />
<Compile Include="Models\Steps\SpillStep.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
=======
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
@ -120,6 +50,7 @@
<Compile Include="Interfaces\GarbageCollector\IGarbageCollector.cs" />
<Compile Include="Interfaces\Garbage\AGarbage.cs" />
<Compile Include="Interfaces\Garbage\IGarbage.cs" />
<Compile Include="Interfaces\IRoad.cs" />
<Compile Include="Interfaces\TrashCans\ADump.cs" />
<Compile Include="Interfaces\IGarbageLocalization.cs" />
<Compile Include="Interfaces\ITypeOfGarbage.cs" />
@ -135,5 +66,4 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
>>>>>>> 9aaa79a5c5258bc287f1041f4b31f5a40e5cf25f
</Project>

View File

@ -1,42 +1,3 @@
<<<<<<< HEAD
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CzokoŚmieciarka.DataModels.Interfaces.TrashCans;
using CzokoŚmieciarka.DataModels.Models;
namespace CzokoŚmieciarka.DataModels.Interfaces.GarbageCollector
{
public abstract class AGarbageCollector : IGarbageCollector
{
public AGarbageCollector(Coords startPosition, IEnumerable<AGarbageCollectorContainer> trashContainers)
{
this.Coords = startPosition;
this.TrashContainers = trashContainers;
}
public Coords Coords { get; set; }
public Coords MoveUp()
{
return new Coords(Coords.X,Coords.Y+1);
}
public Coords MoveDown()
{
return new Coords(Coords.X, Coords.Y - 1);
}
public Coords MoveLeft()
{
return new Coords(Coords.X-1, Coords.Y);
}
public Coords MoveRight()
{
return new Coords(Coords.X+1, Coords.Y);
=======
using System;
using System.Collections.Generic;
using System.Linq;
@ -94,7 +55,6 @@ namespace CzokoŚmieciarka.DataModels.Interfaces.GarbageCollector
throw new OutOfGridException();
}
Coords.X += 1;
>>>>>>> 9aaa79a5c5258bc287f1041f4b31f5a40e5cf25f
}
public object Clone()

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CzokoŚmieciarka.DataModels.Interfaces
{
public interface IRoad
{
}
}

View File

@ -11,28 +11,95 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.WPFv2", "I
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.AI_Naive", "Components\CzokoŚmieciarka.AI_Naive\CzokoŚmieciarka.AI_Naive.csproj", "{10E77BBE-55E1-483D-A456-0E94EAC9B24A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGameView", "MonoGameView\MonoGameView.csproj", "{EBE9431C-9B66-4300-B288-7A0F7B899415}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|ARM.ActiveCfg = Debug|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|ARM.Build.0 = Debug|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|x64.ActiveCfg = Debug|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|x64.Build.0 = Debug|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|x86.ActiveCfg = Debug|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Debug|x86.Build.0 = Debug|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Release|Any CPU.Build.0 = Release|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Release|ARM.ActiveCfg = Release|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Release|ARM.Build.0 = Release|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Release|x64.ActiveCfg = Release|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Release|x64.Build.0 = Release|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Release|x86.ActiveCfg = Release|Any CPU
{F2E11FEE-C5AC-47D2-BA9C-819909B6DFF7}.Release|x86.Build.0 = Release|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|ARM.ActiveCfg = Debug|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|ARM.Build.0 = Debug|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|x64.ActiveCfg = Debug|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|x64.Build.0 = Debug|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|x86.ActiveCfg = Debug|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|x86.Build.0 = Debug|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|Any CPU.Build.0 = Release|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|ARM.ActiveCfg = Release|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|ARM.Build.0 = Release|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|x64.ActiveCfg = Release|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|x64.Build.0 = Release|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|x86.ActiveCfg = Release|Any CPU
{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|x86.Build.0 = Release|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|ARM.ActiveCfg = Debug|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|ARM.Build.0 = Debug|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|x64.ActiveCfg = Debug|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|x64.Build.0 = Debug|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|x86.ActiveCfg = Debug|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|x86.Build.0 = Debug|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|Any CPU.Build.0 = Release|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|ARM.ActiveCfg = Release|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|ARM.Build.0 = Release|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|x64.ActiveCfg = Release|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|x64.Build.0 = Release|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|x86.ActiveCfg = Release|Any CPU
{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|x86.Build.0 = Release|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|ARM.ActiveCfg = Debug|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|ARM.Build.0 = Debug|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|x64.ActiveCfg = Debug|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|x64.Build.0 = Debug|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|x86.ActiveCfg = Debug|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|x86.Build.0 = Debug|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|Any CPU.Build.0 = Release|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|ARM.ActiveCfg = Release|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|ARM.Build.0 = Release|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|x64.ActiveCfg = Release|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|x64.Build.0 = Release|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|x86.ActiveCfg = Release|Any CPU
{10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|x86.Build.0 = Release|Any CPU
{EBE9431C-9B66-4300-B288-7A0F7B899415}.Debug|Any CPU.ActiveCfg = Debug|x86
{EBE9431C-9B66-4300-B288-7A0F7B899415}.Debug|Any CPU.Build.0 = Debug|x86
{EBE9431C-9B66-4300-B288-7A0F7B899415}.Debug|ARM.ActiveCfg = Debug|x86
{EBE9431C-9B66-4300-B288-7A0F7B899415}.Debug|x64.ActiveCfg = Debug|x86
{EBE9431C-9B66-4300-B288-7A0F7B899415}.Debug|x86.ActiveCfg = Debug|x86
{EBE9431C-9B66-4300-B288-7A0F7B899415}.Debug|x86.Build.0 = Debug|x86
{EBE9431C-9B66-4300-B288-7A0F7B899415}.Release|Any CPU.ActiveCfg = Release|x86
{EBE9431C-9B66-4300-B288-7A0F7B899415}.Release|ARM.ActiveCfg = Release|x86
{EBE9431C-9B66-4300-B288-7A0F7B899415}.Release|x64.ActiveCfg = Release|x86
{EBE9431C-9B66-4300-B288-7A0F7B899415}.Release|x86.ActiveCfg = Release|x86
{EBE9431C-9B66-4300-B288-7A0F7B899415}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -73,6 +73,7 @@
<Compile Include="Models\Dump.cs" />
<Compile Include="Models\GarbageCollector.cs" />
<Compile Include="Models\House.cs" />
<Compile Include="Models\ImageContainer.cs" />
<Compile Include="Models\Road.cs" />
<Compile Include="Models\Road2.cs" />
<Compile Include="Properties\Annotations.cs" />

View File

@ -13,7 +13,6 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Czoko_Smieciarka.AI_Naive;
using CzokoŚmieciarka.DataModels.Enums;
using CzokoŚmieciarka.DataModels.GeneralModels.Models;
using CzokoŚmieciarka.DataModels.Interfaces;
@ -34,7 +33,6 @@ namespace CzokoŚmieciarka.WPFv2
IWPFObject[,] Objects = new IWPFObject[Columns,Rows];
private IEnumerable<AGarbageCollectorContainer> GarbageCollectorContainers;
private WPFGarbageCollector garbageCollector;
private RoutePlanningEngine routePlanningEngine;
public MainWindow()
{
@ -145,14 +143,7 @@ namespace CzokoŚmieciarka.WPFv2
Board.Children.Add(Objects[1, 3].Image);
routePlanningEngine = new RoutePlanningEngine(garbageCollector,
new List<IGarbageLocalization>()
{
new GarbageLocalization(house.Coords,house.TrashCans)
},
new List<ADump>()
{
});
}
}
}

View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
namespace CzokoŚmieciarka.WPFv2.Models
{
public sealed class ImageContainer
{
private static ImageContainer _Instance = null;
private Dictionary<string, Image> Images;
public static ImageContainer Instance {
get {
if (_Instance == null)
{
_Instance = new ImageContainer();
}
return _Instance;
}
}
public ImageContainer()
{
Images = new Dictionary<string, Image>();
Images.Add("Road", new Image { Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png")) });
}
public Image GetImage(string s)
{
return Images[s];
}
}
}

View File

@ -7,31 +7,24 @@ using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using CzokoŚmieciarka.DataModels.Models;
using CzokoŚmieciarka.DataModels.Interfaces.Road;
using CzokoŚmieciarka.DataModels.Interfaces;
using CzokoŚmieciarka.WPFv2.Interfaces;
namespace CzokoŚmieciarka.WPFv2.Models
{
class Road : IWPFObject, IRoad
{
public Image Image { get; set; }
//{
// get
// {
// return new Image
// {
// Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png"))
// };
// }
//}
public Image Image
{
get
{
return ImageContainer.Instance.GetImage("Road");
}
}
public Road()
{
Image = new Image()
{
Source =
new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png"))
};
}
public Coords Coords { get; set; }

View File

@ -7,11 +7,11 @@ using System.Windows.Controls;
using System.Windows.Media.Imaging;
using CzokoŚmieciarka.DataModels.Models;
using CzokoŚmieciarka.WPFv2.Interfaces;
using CzokoŚmieciarka.DataModels.Interfaces.Road;
using CzokoŚmieciarka.DataModels.Interfaces;
namespace CzokoŚmieciarka.WPFv2.Models
{
class Road2 : IWPFObject, IRoad2
class Road2 : IWPFObject, IRoad
{
public string ImagePath { get; set; }
public Image Image { get; set; }

View File

@ -0,0 +1,39 @@
#----------------------------- Global Properties ----------------------------#
/outputDir:bin/$(Platform)
/intermediateDir:obj/$(Platform)
/platform:Windows
/config:
/profile:Reach
/compress:False
#-------------------------------- References --------------------------------#
#---------------------------------- Content ---------------------------------#
#begin intersection.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:intersection.png
#begin road.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:road.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

View File

@ -0,0 +1,92 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
namespace MonoGameView
{
/// <summary>
/// This is the main type for your game.
/// </summary>
public class Game1 : Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Texture2D road;
Vector2 roadPos;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreferredBackBufferWidth = 500;
graphics.PreferredBackBufferHeight = 500;
}
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
roadPos = new Vector2(0, 0);
base.Initialize();
}
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
road = Content.Load<Texture2D>("road");
// TODO: use this.Content to load your game content here
}
/// <summary>
/// UnloadContent will be called once per game and is the place to unload
/// game-specific content.
/// </summary>
protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
}
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
Exit();
// TODO: Add your update logic here
double time = gameTime.TotalGameTime.TotalMilliseconds / 1000 * Math.PI;
roadPos.X = (float) (225 + 200*Math.Sin(time));
roadPos.Y = (float)(225 + 200*Math.Cos(time));
base.Update(gameTime);
}
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
spriteBatch.Draw(road, roadPos, Color.White);
spriteBatch.End();
// TODO: Add your drawing code here
base.Draw(gameTime);
}
}
}

BIN
Trunk/MonoGameView/Icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{EBE9431C-9B66-4300-B288-7A0F7B899415}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MonoGameView</RootNamespace>
<AssemblyName>MonoGameView</AssemblyName>
<FileAlignment>512</FileAlignment>
<MonoGamePlatform>Windows</MonoGamePlatform>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
<DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
<DefineConstants>TRACE;WINDOWS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Compile Include="Game1.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="MonoGame.Framework">
<HintPath>$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\Windows\MonoGame.Framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Content Include="Icon.ico" />
</ItemGroup>
<ItemGroup>
<MonoGameContentReference Include="Content\Content.mgcb" />
<None Include="app.manifest" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,22 @@
using System;
namespace MonoGameView
{
#if WINDOWS || LINUX
/// <summary>
/// The main class.
/// </summary>
public static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
using (var game = new Game1())
game.Run();
}
}
#endif
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MonoGameView")]
[assembly: AssemblyProduct("MonoGameView")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0ff0f801-46a1-4452-8feb-12cb0986ff52")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MonoGameView"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on and is
is designed to work with. Uncomment the appropriate elements and Windows will
automatically selected the most compatible environment. -->
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
</windowsSettings>
</application>
</assembly>