Skip to content

Commit

Permalink
Move project files to subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
LiZhenhuan1019 committed Feb 8, 2021
1 parent 4158007 commit 8173439
Show file tree
Hide file tree
Showing 93 changed files with 171 additions and 166 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.vs/
source/package/
source/bin/
source/obj/
source/*/bin/
source/*/obj/
*.DotSettings.user
*.csproj.user
*.dll
Expand Down
2 changes: 1 addition & 1 deletion source/EnhancedBattleTest.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30802.185
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnhancedBattleTest", "EnhancedBattleTest.csproj", "{2680E8CF-C2FC-4AB8-B1D0-BC1F63AD5DA1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnhancedBattleTest", "EnhancedBattleTest\EnhancedBattleTest.csproj", "{2680E8CF-C2FC-4AB8-B1D0-BC1F63AD5DA1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,104 +1,104 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<ProcessorArchitecture>amd64</ProcessorArchitecture>
<LangVersion>8</LangVersion>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<Import Project="$(MSBuildProjectDirectory)\*.props" />
<ItemGroup>
<PackageReference Include="Lib.Harmony" Version="2.0.4" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-md2html" Version="1.0.0.1-preview1" />
</ItemGroup>
<ItemGroup>
<Reference Include="SandBox">
<HintPath>$(GamePath)\Modules\SandBox\bin\Win64_Shipping_Client\SandBox.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="SandBox.GauntletUI">
<HintPath>$(GamePath)\Modules\SandBox\bin\Win64_Shipping_Client\SandBox.GauntletUI.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="SandBox.View">
<HintPath>$(GamePath)\Modules\SandBox\bin\Win64_Shipping_Client\SandBox.View.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.CampaignSystem">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.CampaignSystem.ViewModelCollection">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.ViewModelCollection.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.Core">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.Core.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.Core.ViewModelCollection">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.Core.ViewModelCollection.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.DotNet">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.DotNet.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.Engine">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.Engine.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.Engine.GauntletUI">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.Engine.GauntletUI.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.GauntletUI.Data">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.GauntletUI.Data.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.InputSystem">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.InputSystem.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.Library">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.Library.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.Localization">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.Localization.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.MountAndBlade">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.MountAndBlade.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.MountAndBlade.CustomBattle">
<HintPath>$(GamePath)\Modules\CustomBattle\bin\Win64_Shipping_Client\TaleWorlds.MountAndBlade.CustomBattle.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.MountAndBlade.View">
<HintPath>$(GamePath)\Modules\Native\bin\Win64_Shipping_Client\TaleWorlds.MountAndBlade.View.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.MountAndBlade.ViewModelCollection">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.MountAndBlade.ViewModelCollection.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.ObjectSystem">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.ObjectSystem.dll</HintPath>
<Private>false</Private>
</Reference>
</ItemGroup>
<Target Name="RemoveModulePackageDir" AfterTargets="BeforeBuild">
<Exec Command="rmdir &quot;$(ModulePackagePath)&quot; /s /q" />
</Target>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy &quot;$(TargetPath)&quot; &quot;$(ModulePackagePath)bin\Win64_Shipping_Client\&quot; /C /I /Y /F" />
<Exec Command="xcopy &quot;$(ProjectDir)Modules\.&quot; &quot;$(PackagePath)&quot; /E /C /I /Y /F" />
<Exec Command="xcopy &quot;$(ModulePackagePath).&quot; &quot;$(GamePath)Modules\$(ModuleAlias) &quot; /E /C /I /Y /F" />
</Target>
</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<ProcessorArchitecture>amd64</ProcessorArchitecture>
<LangVersion>8</LangVersion>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<Import Project="$(MSBuildProjectDirectory)\*.props" />
<ItemGroup>
<PackageReference Include="Lib.Harmony" Version="2.0.4" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-md2html" Version="1.0.0.1-preview1" />
</ItemGroup>
<ItemGroup>
<Reference Include="SandBox">
<HintPath>$(GamePath)\Modules\SandBox\bin\Win64_Shipping_Client\SandBox.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="SandBox.GauntletUI">
<HintPath>$(GamePath)\Modules\SandBox\bin\Win64_Shipping_Client\SandBox.GauntletUI.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="SandBox.View">
<HintPath>$(GamePath)\Modules\SandBox\bin\Win64_Shipping_Client\SandBox.View.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.CampaignSystem">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.CampaignSystem.ViewModelCollection">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.ViewModelCollection.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.Core">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.Core.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.Core.ViewModelCollection">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.Core.ViewModelCollection.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.DotNet">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.DotNet.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.Engine">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.Engine.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.Engine.GauntletUI">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.Engine.GauntletUI.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.GauntletUI.Data">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.GauntletUI.Data.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.InputSystem">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.InputSystem.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.Library">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.Library.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.Localization">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.Localization.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.MountAndBlade">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.MountAndBlade.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.MountAndBlade.CustomBattle">
<HintPath>$(GamePath)\Modules\CustomBattle\bin\Win64_Shipping_Client\TaleWorlds.MountAndBlade.CustomBattle.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.MountAndBlade.View">
<HintPath>$(GamePath)\Modules\Native\bin\Win64_Shipping_Client\TaleWorlds.MountAndBlade.View.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.MountAndBlade.ViewModelCollection">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.MountAndBlade.ViewModelCollection.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="TaleWorlds.ObjectSystem">
<HintPath>$(GamePath)\bin\Win64_Shipping_Client\TaleWorlds.ObjectSystem.dll</HintPath>
<Private>false</Private>
</Reference>
</ItemGroup>
<Target Name="RemoveModulePackageDir" AfterTargets="BeforeBuild">
<Exec Command="rmdir &quot;$(ModulePackagePath)&quot; /s /q" />
</Target>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy &quot;$(TargetPath)&quot; &quot;$(ModulePackagePath)bin\Win64_Shipping_Client\&quot; /C /I /Y /F" />
<Exec Command="xcopy &quot;$(ProjectDir)Modules\.&quot; &quot;$(PackagePath)&quot; /E /C /I /Y /F" />
<Exec Command="xcopy &quot;$(ModulePackagePath).&quot; &quot;$(GamePath)Modules\$(ModuleAlias) &quot; /E /C /I /Y /F" />
</Target>
</Project>
5 changes: 5 additions & 0 deletions source/EnhancedBattleTest/GamePath.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<GamePath>C:\Program Files (x86)\Steam\steamapps\common\Mount &amp; Blade II Bannerlord\</GamePath>
</PropertyGroup>
</Project>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public abstract class CharacterConfig

public static CharacterConfig Create(bool isMultiplayer)
{
if (isMultiplayer)
{
return new MPCharacterConfig();
if (isMultiplayer)
{
return new MPCharacterConfig();
}
else
{
return new SPCharacterConfig();
else
{
return new SPCharacterConfig();
}
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public abstract class CharacterCollection

public static CharacterCollection Create(bool isMultiplayer)
{
if (isMultiplayer)
{
return new MPCharacterCollection();
if (isMultiplayer)
{
return new MPCharacterCollection();
}
else
{
return new SPCharacterCollection();
else
{
return new SPCharacterCollection();
}
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ private static AtmosphereInfo CreateAtmosphereInfoForMission(string seasonString
public static Mission OpenMission(BattleConfig config, string mapName)
{
//TODO: implement in multiplayer mode
if (EnhancedBattleTestSubModule.IsMultiplayer)
{
return OpenMultiplayerMission(config, mapName);
if (EnhancedBattleTestSubModule.IsMultiplayer)
{
return OpenMultiplayerMission(config, mapName);
}
else
{
return OpenSingleplayerMission(config, mapName);
else
{
return OpenSingleplayerMission(config, mapName);
}
}

Expand Down Expand Up @@ -135,8 +135,8 @@ public static Mission OpenMission(IEnhancedBattleTestCombatant playerParty,
return OpenEnhancedBattleTestSiege(map, config, playerParty, enemyParty, hitPointPercentages,
attackerSiegeWeaponCount, defenderSiegeWeaponCount);
}
else
{
else
{
return OpenEnhancedBattleTestField(map, config, playerParty, enemyParty);
}
}
Expand Down Expand Up @@ -406,13 +406,13 @@ public static Mission OpenEnhancedBattleTestField(

private static IEnhancedBattleTestTroopSupplier CreateTroopSupplier(IEnhancedBattleTestCombatant combatant, bool isMultiplayer)
{
if (isMultiplayer)
{
return new MPTroopSupplier(combatant);
if (isMultiplayer)
{
return new MPTroopSupplier(combatant);
}
else
{
return new SPTroopSupplier(combatant);
else
{
return new SPTroopSupplier(combatant);
}
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,26 @@ public override Agent SpawnTroop(BattleSideEnum side, bool hasFormation, bool sp
var equipment = Equipment.GetRandomEquipmentElements(troop, equipmentModifierType == EquipmentModifierType.Random,
agentBuildData.AgentCivilianEquipment,
agentBuildData.AgentEquipmentSeed);
if (equipmentModifierType == EquipmentModifierType.Average)
{
for (EquipmentIndex index = EquipmentIndex.Weapon0;
index < EquipmentIndex.NumEquipmentSetSlots;
++index)
{
var equipmentElement = equipment.GetEquipmentFromSlot(index);
if (equipmentElement.Item != null)
{
if (equipmentElement.Item.HasArmorComponent)
equipmentElement.SetModifier(
Utility.AverageItemModifier(equipmentElement.Item.ArmorComponent
.ItemModifierGroup));
else if (equipmentElement.Item.HasHorseComponent)
equipmentElement.SetModifier(
Utility.AverageItemModifier(equipmentElement.Item.HorseComponent
.ItemModifierGroup));
}
}
}
if (equipmentModifierType == EquipmentModifierType.Average)
{
for (EquipmentIndex index = EquipmentIndex.Weapon0;
index < EquipmentIndex.NumEquipmentSetSlots;
++index)
{
var equipmentElement = equipment.GetEquipmentFromSlot(index);
if (equipmentElement.Item != null)
{
if (equipmentElement.Item.HasArmorComponent)
equipmentElement.SetModifier(
Utility.AverageItemModifier(equipmentElement.Item.ArmorComponent
.ItemModifierGroup));
else if (equipmentElement.Item.HasHorseComponent)
equipmentElement.SetModifier(
Utility.AverageItemModifier(equipmentElement.Item.HorseComponent
.ItemModifierGroup));
}
}
}

agentBuildData.Equipment(equipment);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public static SPCombatant CreateParty(PartyBase party, BattleSideEnum side, Basi
teamConfig.Banner);
if (teamConfig.HasGeneral)
{
if (teamConfig.General is SPCharacterConfig general)
{
if (teamConfig.General is SPCharacterConfig general)
{
combatant.AddCharacter(
new SPSpawnableCharacter(general, (int)general.CharacterObject.DefaultFormationGroup,
general.FemaleRatio > 0.5, isPlayerTeam), 1);
Expand All @@ -66,11 +66,11 @@ public static SPCombatant CreateParty(PartyBase party, BattleSideEnum side, Basi
for (int i = 0; i < teamConfig.Troops.Troops.Length; ++i)
{
var troopConfig = teamConfig.Troops.Troops[i];
if (troopConfig.Character is SPCharacterConfig spCharacter)
{
var femaleCount = (int)(troopConfig.Number * spCharacter.FemaleRatio + 0.49);
var maleCount = troopConfig.Number - femaleCount;
combatant.AddCharacter(new SPSpawnableCharacter(spCharacter, i, true), femaleCount);
if (troopConfig.Character is SPCharacterConfig spCharacter)
{
var femaleCount = (int)(troopConfig.Number * spCharacter.FemaleRatio + 0.49);
var maleCount = troopConfig.Number - femaleCount;
combatant.AddCharacter(new SPSpawnableCharacter(spCharacter, i, true), femaleCount);
combatant.AddCharacter(new SPSpawnableCharacter(spCharacter, i, false), maleCount);
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 8173439

Please sign in to comment.