<?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>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
    <LangVersion>9.0</LangVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
    <DefineConstants>DEBUG;TRACE</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>none</DebugType>
    <Optimize>true</Optimize>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>

  <PropertyGroup>
    <SCERoot>..</SCERoot>
    <SCERoot Condition="$(IsSubProject) == 'True'">../$(SCERoot)</SCERoot>
  </PropertyGroup>

  <!-- Find the RimWorld install directory even on weird setups. Adapted from RJW of all places -->
  <Choose>
    <!-- Windows x86 -->
    <When Condition="Exists('C:\Program Files (x86)\Steam\steamapps\common\RimWorld')">
      <PropertyGroup>
        <RWPath>C:\Program Files (x86)\Steam\steamapps\common\RimWorld</RWPath>
      </PropertyGroup>
    </When>
    <!-- Windows x64 -->
    <When Condition="Exists('C:\Program Files\Steam\steamapps\common\RimWorld')">
      <PropertyGroup>
        <RWPath>C:\Program Files\Steam\steamapps\common\RimWorld</RWPath>
      </PropertyGroup>
    </When>
    <!-- Linux -->
    <When Condition="Exists('$(HOME)\.steam\steam')">
      <PropertyGroup>
        <RWPath>$(HOME)\.steam\steam\steamapps\common\RimWorld</RWPath>
      </PropertyGroup>
    </When>
    <!-- MacOS -->
    <When Condition="Exists('$(HOME)\Library\Application Support\Steam')">
      <PropertyGroup>
        <RWPath>$(HOME)\Library\Application Support\Steam\steamapps\common\RimWorld</RWPath>
      </PropertyGroup>
    </When>
    <!-- Custom location defined in an environment variable -->
    <When Condition="Exists('$(RIMWORLD)\Data\Core')">
      <PropertyGroup>
        <RWPath>$(RIMWORLD)</RWPath>
      </PropertyGroup>
    </When>
    <!-- Fallback: just assume we're in a filestructure normal enough that the user doesn't feel the need to define ${RIMWORLD} -->
    <Otherwise>
      <PropertyGroup>
        <RWPath>$(SCERoot)\..\..\..</RWPath>
      </PropertyGroup>
    </Otherwise>
  </Choose>
  <PropertyGroup>
    <ReferencePath>
      $(RWPath)\RimWorldWin_Data\Managed;
      $(RWPath)\RimWorldWin64_Data\Managed;
      $(RWPath)\RimWorldLinux_Data\Managed;
      $(RWPath)\RimWorldMac.app\Contents\Resources\Data\Managed;
      $(ReferencePath)
    </ReferencePath>
  </PropertyGroup>

  <!-- References-->
  <ItemGroup>
    <Reference Include="0Harmony">
      <HintPath Condition="Exists('$(SCERoot)/Lib')">$(SCERoot)/Lib/0Harmony.dll</HintPath>
      <HintPath Condition="!Exists('$(SCERoot)/Lib')">$(RWPATH)/../../workshop/content/294100/2009463077/Current/Assemblies/0Harmony.dll</HintPath>
      <SpecificVersion>False</SpecificVersion>
      <Private>False</Private>
    </Reference>
    <Reference Include="Assembly-CSharp">
      <HintPath>$(RWPath)/RimWorldWin64_Data/Managed/Assembly-CSharp.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="RJW">
      <HintPath Condition="Exists('$(SCERoot)/../RJW')">$(SCERoot)/../RJW/1.4/Assemblies/RJW.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="RimJobWorldWhoring">
      <HintPath Condition="Exists('$(SCERoot)/Lib')">$(SCERoot)/Lib/RimJobWorldWhoring.dll</HintPath>
      <HintPath Condition="!Exists('$(SCERoot)/Lib')">$(SCERoot)/../RJW-Whoring/1.4/Assemblies/RimJobWorldWhoring.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
    <Reference Include="UnityEngine.CoreModule">
      <Private>False</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup Condition="$(IsSubProject) == 'True'">
    <Reference Include="$(SCERoot)/Assemblies/SexCultEssentials.dll">
      <Private>False</Private>
    </Reference>
  </ItemGroup>
</Project>