<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <ImportGroup>
    <Import Project="../GamePaths.xml" />
  </ImportGroup>
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProjectGuid>{91AB81DE-EAEE-47D1-93DD-541179208219}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MultiplayerClientSpawn</RootNamespace>
    <AssemblyName>MultiplayerClientSpawn</AssemblyName>
    <TargetFrameworks>net35</TargetFrameworks>
    <FileAlignment>512</FileAlignment>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <Configurations>Release</Configurations>
    <Authors>Zariteis</Authors>
    <ApplicationIcon />
    <StartupObject />
    <Platforms>x86</Platforms>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>none</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net35|x86'">
    <NoWarn>1701;1702</NoWarn>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="0Harmony">
      <HintPath>$(GamePath)$(ManagedFolder)0Harmony.dll</HintPath>
      <Private>false</Private>
    </Reference>
    <Reference Include="Assembly-CSharp">
      <HintPath>$(GamePath)$(ManagedFolder)Assembly-CSharp.dll</HintPath>
      <Private>false</Private>
    </Reference>
    <Reference Include="GadgetCore">
      <HintPath>$(GamePath)$(ManagedFolder)GadgetCore.dll</HintPath>
      <Private>false</Private>
    </Reference>
    <Reference Include="ScrapYard">
      <HintPath>..\ScrapYard\Release\ScrapYard.dll</HintPath>
      <Private>false</Private>
      <SpecificVersion>false</SpecificVersion>
    </Reference>
    <Reference Include="UnityEngine">
      <HintPath>$(GamePath)$(ManagedFolder)UnityEngine.dll</HintPath>
      <Private>false</Private>
    </Reference>
    <Reference Include="WindowsBase" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="ModInfo.txt">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <UsingTask TaskName="GetFileVersion" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
    <ParameterGroup>
      <AssemblyPath ParameterType="System.String" Required="true" />
      <Version ParameterType="System.String" Output="true" />
      <TrimmedVersion ParameterType="System.String" Output="true" />
    </ParameterGroup>
    <Task>
      <Using Namespace="System.Diagnostics" />
      <Using Namespace="System.Text" />
      <Using Namespace="System.Linq" />
      <Code Type="Fragment" Language="cs">
        <![CDATA[
      this.Version = FileVersionInfo.GetVersionInfo(this.AssemblyPath).FileVersion;  
      this.TrimmedVersion = this.Version.Split('.').TakeWhile(x => !x.Equals("0")).Aggregate(new StringBuilder(), (a, b) => { if (a.Length > 0) a.Append("."); a.Append(b); return a; }).ToString();
      if (this.TrimmedVersion.IndexOf('.') == -1) this.TrimmedVersion += ".0";
    ]]>
      </Code>
    </Task>
  </UsingTask>
  <Target Name="PostBuild" AfterTargets="PostBuildEvent">
    <GetFileVersion AssemblyPath="$(TargetPath)">
      <Output TaskParameter="Version" PropertyName="ModFullVersion" />
      <Output TaskParameter="TrimmedVersion" PropertyName="AssemblyFileVersion" />
    </GetFileVersion>
    <ItemGroup>
      <OldZip Include="$(TargetDir)$(AssemblyName)_v*.zip" />
      <OldZip Include="$(GamePath)GadgetCore\Mods\$(AssemblyName)_v*.zip" />
    </ItemGroup>
    <Delete Files="@(OldZip)" />
    <MakeDir Directories="$(TargetDir)..\BuildCache\" />
    <ZipDirectory SourceDirectory="$(TargetDir)" DestinationFile="$(TargetDir)..\BuildCache\$(AssemblyName)_v$(AssemblyFileVersion).zip" />
    <Copy SourceFiles="$(TargetDir)..\BuildCache\$(AssemblyName)_v$(AssemblyFileVersion).zip" DestinationFiles="$(TargetDir)$(AssemblyName)_v$(AssemblyFileVersion).zip" />
    <RemoveDir Directories="$(TargetDir)..\BuildCache\" />
    <MakeDir Directories="$(GamePath)GadgetCore\Mods\" />
    <Copy SourceFiles="$(TargetDir)$(AssemblyName)_v$(AssemblyFileVersion).zip" DestinationFiles="$(GamePath)GadgetCore\Mods\$(AssemblyName)_v$(AssemblyFileVersion).zip" />
    <Message Importance="High" Text="Mod Exported to $(GamePath)GadgetCore\Mods\$(AssemblyName)_v$(AssemblyFileVersion).zip" />
  </Target>
  <ItemGroup>
    <None Update="Assets\cGreenLamp.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\charBG.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\cOrangeLamp.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\cPlatform.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\cPurpleLamp.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\cWhiteLamp.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\cYellowLamp.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\First\one">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\iAirCore.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\iCore.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\iEarthCore.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\iFireCore.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\iGreenLamp.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\iOrangeLamp.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\iPlatform.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\iPurpleLamp.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\iSpawn.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\iWaterCore.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\iWhiteLamp.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\iYellowLamp.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\one">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\spawnpoint.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\spawnpoint0.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Assets\spawnpoint1.png">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="Manifest.ini">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Reference Update="System">
      <Private>false</Private>
      <SpecificVersion>true</SpecificVersion>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Reference Update="System.Data">
      <EmbedInteropTypes>false</EmbedInteropTypes>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Reference Update="System.Drawing">
      <EmbedInteropTypes>false</EmbedInteropTypes>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Reference Update="System.IO.Compression.FileSystem">
      <EmbedInteropTypes>false</EmbedInteropTypes>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Reference Update="System.Numerics">
      <EmbedInteropTypes>false</EmbedInteropTypes>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Reference Update="System.Runtime.Serialization">
      <EmbedInteropTypes>false</EmbedInteropTypes>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Reference Update="System.Xml">
      <EmbedInteropTypes>false</EmbedInteropTypes>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Reference Update="System.Xml.Linq">
      <EmbedInteropTypes>false</EmbedInteropTypes>
    </Reference>
  </ItemGroup>
</Project>