Skip to content

Commit d1dbbdd

Browse files
committed
举例
1 parent 1e24faf commit d1dbbdd

6 files changed

Lines changed: 181 additions & 6 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace VisitorPattern
8+
{
9+
/// <summary>
10+
/// 抽象的领导类
11+
/// </summary>
12+
abstract class Leader
13+
{
14+
public abstract void VisitFinancialReport();
15+
public abstract void VisitLogisticsReport();
16+
}
17+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace VisitorPattern
8+
{
9+
/// <summary>
10+
/// 抽象报表
11+
/// </summary>
12+
abstract class Reporter
13+
{
14+
/// <summary>
15+
/// 抽象的接受访问方法
16+
/// </summary>
17+
/// <param name="leader"></param>
18+
public abstract void Accecpt(Leader leader);
19+
}
20+
}

DesignPatterns/VisitorPattern/VisitorPattern/VisitorPattern.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@
4343
</ItemGroup>
4444
<ItemGroup>
4545
<Compile Include="Element.cs" />
46+
<Compile Include="Leader.cs" />
4647
<Compile Include="ObjectStructure.cs" />
4748
<Compile Include="Program.cs" />
4849
<Compile Include="Properties\AssemblyInfo.cs" />
50+
<Compile Include="Reporter.cs" />
4951
<Compile Include="Visitor.cs" />
5052
</ItemGroup>
5153
<ItemGroup>

Fruit_Ninja/Fruit_Ninja.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
<Reference Include="UnityEngine">
5353
<HintPath>Library\UnityAssemblies\UnityEngine.dll</HintPath>
5454
</Reference>
55+
<Reference Include="UnityEngine.Advertisements">
56+
<HintPath>Library\UnityAssemblies\UnityEngine.Advertisements.dll</HintPath>
57+
</Reference>
5558
<Reference Include="UnityEngine.UI">
5659
<HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
5760
</Reference>
@@ -67,6 +70,9 @@
6770
<Reference Include="UnityEngine.HoloLens">
6871
<HintPath>Library\UnityAssemblies\UnityEngine.HoloLens.dll</HintPath>
6972
</Reference>
73+
<Reference Include="UnityEngine.Purchasing">
74+
<HintPath>Library\UnityAssemblies\UnityEngine.Purchasing.dll</HintPath>
75+
</Reference>
7076
<Reference Include="UnityEngine.VR">
7177
<HintPath>Library\UnityAssemblies\UnityEngine.VR.dll</HintPath>
7278
</Reference>
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>10.0.20506</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{4C04E8B6-B06F-85BE-46ED-A4516BEDC6D8}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AssemblyName>Assembly-CSharp-Editor</AssemblyName>
11+
<FileAlignment>512</FileAlignment>
12+
<ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
13+
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
14+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
15+
<TargetFrameworkProfile>Unity Full v3.5</TargetFrameworkProfile>
16+
<CompilerResponseFile></CompilerResponseFile>
17+
<UnityProjectType>Editor:5</UnityProjectType>
18+
<UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
19+
<UnityVersion>5.5.0f3</UnityVersion>
20+
<RootNamespace></RootNamespace>
21+
<LangVersion>4</LangVersion>
22+
</PropertyGroup>
23+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
24+
<DebugType>pdbonly</DebugType>
25+
<Optimize>false</Optimize>
26+
<OutputPath>Temp\UnityVS_bin\Debug\</OutputPath>
27+
<IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
28+
<ErrorReport>prompt</ErrorReport>
29+
<WarningLevel>4</WarningLevel>
30+
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_5_0;UNITY_5_5;UNITY_5;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VIDEO;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE</DefineConstants>
31+
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
32+
</PropertyGroup>
33+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
34+
<DebugType>pdbonly</DebugType>
35+
<Optimize>false</Optimize>
36+
<OutputPath>Temp\UnityVS_bin\Release\</OutputPath>
37+
<IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
38+
<ErrorReport>prompt</ErrorReport>
39+
<WarningLevel>4</WarningLevel>
40+
<DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_5_0;UNITY_5_5;UNITY_5;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VIDEO;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE</DefineConstants>
41+
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
42+
</PropertyGroup>
43+
<ItemGroup>
44+
<Reference Include="mscorlib" />
45+
<Reference Include="System" />
46+
<Reference Include="System.XML" />
47+
<Reference Include="System.Core" />
48+
<Reference Include="Boo.Lang" />
49+
<Reference Include="UnityScript.Lang" />
50+
<Reference Include="System.Runtime.Serialization" />
51+
<Reference Include="System.Xml.Linq" />
52+
<Reference Include="UnityEngine">
53+
<HintPath>Library\UnityAssemblies\UnityEngine.dll</HintPath>
54+
</Reference>
55+
<Reference Include="UnityEditor">
56+
<HintPath>Library\UnityAssemblies\UnityEditor.dll</HintPath>
57+
</Reference>
58+
<Reference Include="UnityEditor.Advertisements">
59+
<HintPath>Library\UnityAssemblies\UnityEditor.Advertisements.dll</HintPath>
60+
</Reference>
61+
<Reference Include="nunit.framework">
62+
<HintPath>Library\UnityAssemblies\nunit.framework.dll</HintPath>
63+
</Reference>
64+
<Reference Include="UnityEditor.EditorTestsRunner">
65+
<HintPath>Library\UnityAssemblies\UnityEditor.EditorTestsRunner.dll</HintPath>
66+
</Reference>
67+
<Reference Include="UnityEngine.UI">
68+
<HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
69+
</Reference>
70+
<Reference Include="UnityEditor.UI">
71+
<HintPath>Library\UnityAssemblies\UnityEditor.UI.dll</HintPath>
72+
</Reference>
73+
<Reference Include="UnityEngine.Networking">
74+
<HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
75+
</Reference>
76+
<Reference Include="UnityEditor.Networking">
77+
<HintPath>Library\UnityAssemblies\UnityEditor.Networking.dll</HintPath>
78+
</Reference>
79+
<Reference Include="UnityEditor.PlaymodeTestsRunner">
80+
<HintPath>Library\UnityAssemblies\UnityEditor.PlaymodeTestsRunner.dll</HintPath>
81+
</Reference>
82+
<Reference Include="UnityEngine.PlaymodeTestsRunner">
83+
<HintPath>Library\UnityAssemblies\UnityEngine.PlaymodeTestsRunner.dll</HintPath>
84+
</Reference>
85+
<Reference Include="UnityEditor.TreeEditor">
86+
<HintPath>Library\UnityAssemblies\UnityEditor.TreeEditor.dll</HintPath>
87+
</Reference>
88+
<Reference Include="UnityEngine.Analytics">
89+
<HintPath>Library\UnityAssemblies\UnityEngine.Analytics.dll</HintPath>
90+
</Reference>
91+
<Reference Include="UnityEditor.Analytics">
92+
<HintPath>Library\UnityAssemblies\UnityEditor.Analytics.dll</HintPath>
93+
</Reference>
94+
<Reference Include="UnityEditor.HoloLens">
95+
<HintPath>Library\UnityAssemblies\UnityEditor.HoloLens.dll</HintPath>
96+
</Reference>
97+
<Reference Include="UnityEngine.HoloLens">
98+
<HintPath>Library\UnityAssemblies\UnityEngine.HoloLens.dll</HintPath>
99+
</Reference>
100+
<Reference Include="UnityEditor.VR">
101+
<HintPath>Library\UnityAssemblies\UnityEditor.VR.dll</HintPath>
102+
</Reference>
103+
<Reference Include="UnityEngine.VR">
104+
<HintPath>Library\UnityAssemblies\UnityEngine.VR.dll</HintPath>
105+
</Reference>
106+
<Reference Include="UnityEditor.Graphs">
107+
<HintPath>Library\UnityAssemblies\UnityEditor.Graphs.dll</HintPath>
108+
</Reference>
109+
<Reference Include="UnityEditor.Android.Extensions">
110+
<HintPath>Library\UnityAssemblies\UnityEditor.Android.Extensions.dll</HintPath>
111+
</Reference>
112+
<Reference Include="UnityEditor.WindowsStandalone.Extensions">
113+
<HintPath>Library\UnityAssemblies\UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
114+
</Reference>
115+
<Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
116+
<HintPath>Library\UnityAssemblies\SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
117+
</Reference>
118+
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework">
119+
<HintPath>Assets\Plugins\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</HintPath>
120+
</Reference>
121+
</ItemGroup>
122+
<ItemGroup>
123+
<Compile Include="Assets\Editor\NegativeHealthException.cs" />
124+
<Compile Include="Assets\Editor\Player.cs" />
125+
<Compile Include="Assets\Editor\PlayerTest.cs" />
126+
<Compile Include="Assets\Editor\PlayerTestWrong.cs" />
127+
</ItemGroup>
128+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
129+
<Target Name="GenerateTargetFrameworkMonikerAttribute" />
130+
</Project>

Unit4Unity/Editor Test Runner/Editor Test Runner.sln

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2012
4-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Editor Test Runner.CSharp.Editor", "Editor Test Runner.CSharp.Editor.csproj", "{E8E0D9C0-24E2-A607-E958-BCF495C69B0D}"
3+
# Visual Studio 2017
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Editor Test Runner.Editor", "Editor Test Runner.Editor.csproj", "{4C04E8B6-B06F-85BE-46ED-A4516BEDC6D8}"
55
EndProject
66
Global
77
GlobalSection(SolutionConfigurationPlatforms) = preSolution
88
Debug|Any CPU = Debug|Any CPU
99
Release|Any CPU = Release|Any CPU
1010
EndGlobalSection
1111
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12-
{E8E0D9C0-24E2-A607-E958-BCF495C69B0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13-
{E8E0D9C0-24E2-A607-E958-BCF495C69B0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
14-
{E8E0D9C0-24E2-A607-E958-BCF495C69B0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
15-
{E8E0D9C0-24E2-A607-E958-BCF495C69B0D}.Release|Any CPU.Build.0 = Release|Any CPU
12+
{4C04E8B6-B06F-85BE-46ED-A4516BEDC6D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13+
{4C04E8B6-B06F-85BE-46ED-A4516BEDC6D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
14+
{4C04E8B6-B06F-85BE-46ED-A4516BEDC6D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
15+
{4C04E8B6-B06F-85BE-46ED-A4516BEDC6D8}.Release|Any CPU.Build.0 = Release|Any CPU
1616
EndGlobalSection
1717
GlobalSection(SolutionProperties) = preSolution
1818
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)