Skip to content

Commit

Permalink
275 reorganize classes into not such a deep namespace hierarchy (#276)
Browse files Browse the repository at this point in the history
* Reorganize namespaces

* Move Extensions namespace

* Move some more namespaces

* Move namespaces in tests
  • Loading branch information
ekolis committed Jan 13, 2024
1 parent f357c99 commit 583f5a3
Show file tree
Hide file tree
Showing 506 changed files with 50,604 additions and 50,578 deletions.
74 changes: 37 additions & 37 deletions FrEee.Assets/Data/EventTypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ EVENT TYPES DATA FILE

Name := Ship - Damage
Is Negative When := amount > 0
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Vehicles import SpaceVehicle;
Import := from FrEee.Game.Interfaces import IUnit;
Import := from FrEee.Game.Interfaces import IVehicle;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Vehicles import SpaceVehicle;
Import := from FrEee.Interfaces import IUnit;
Import := from FrEee.Interfaces import IVehicle;
Target Selector := Galaxy.Current.FindSpaceObjects[SpaceVehicle]().Except[IVehicle](Galaxy.Current.FindSpaceObjects[IUnit]())
Parameter := VehicleName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand All @@ -20,8 +20,8 @@ Action := target.TakeDamage("Skips All Shields", amount);

Name := Ship - Lose Movement
Is Negative When := amount > 0
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Vehicles import Ship;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Vehicles import Ship;
Target Selector := Galaxy.Current.FindSpaceObjects[Ship]()
Parameter := VehicleName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand All @@ -30,8 +30,8 @@ Action := target.MovementRemaining -= amount;

Name := Ship - Lose Supply
Is Negative When := amount > 0
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Vehicles import Ship;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Vehicles import Ship;
Target Selector := Galaxy.Current.FindSpaceObjects[Ship]()
Parameter := VehicleName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand All @@ -40,8 +40,8 @@ Action := target.SupplyRemaining -= amount;

Name := Ship - Cargo Damage
Is Negative When := amount > 0
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Interfaces import ICargoContainer;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Interfaces import ICargoContainer;
Target Selector := Galaxy.Current.FindSpaceObjects[ICargoContainer]()
Parameter := VehicleName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand All @@ -50,10 +50,10 @@ Action := target.Cargo.TakeDamage("Skips All Shields", amount);

Name := Ship - Moved
Is Negative When := true
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Vehicles import SpaceVehicle;
Import := from FrEee.Game.Interfaces import IUnit;
Import := from FrEee.Game.Interfaces import IVehicle;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Vehicles import SpaceVehicle;
Import := from FrEee.Interfaces import IUnit;
Import := from FrEee.Interfaces import IVehicle;
Target Selector := Galaxy.Current.FindSpaceObjects[SpaceVehicle]().Except[IVehicle](Galaxy.Current.FindSpaceObjects[IUnit]())
Parameter := VehicleName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand All @@ -62,9 +62,9 @@ Action := target.Sector = Galaxy.Current.PickRandomSector();

Name := Planet - Conditions Change
Is Negative When := amount < 0
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Space import Planet;
Import := from FrEee.Game.Interfaces import IUnit;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Space import Planet;
Import := from FrEee.Interfaces import IUnit;
Target Selector := Galaxy.Current.FindSpaceObjects[Planet]()
Parameter := PlanetName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand All @@ -73,9 +73,9 @@ Action := # planets don't have conditions yet so do nothing

Name := Planet - Value Change
Is Negative When := amount < 0
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Space import Planet;
Import := from FrEee.Game.Interfaces import IUnit;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Space import Planet;
Import := from FrEee.Interfaces import IUnit;
Import := from FrEee.Utility import Resource;
Target Selector := Galaxy.Current.FindSpaceObjects[Planet]()
Parameter := PlanetName = target.Name;
Expand All @@ -87,8 +87,8 @@ Action := target.Value[Resource.Radioactives] += amount;

Name := Planet - Population Change
Is Negative When := amount < 0
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Space import Planet;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Space import Planet;
Target Selector := Galaxy.Current.FindSpaceObjects[Planet]().Where(lambda p: p.Colony != None)
Parameter := PlanetName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand All @@ -97,19 +97,19 @@ Action := target.Colony.ChangePopulation(amount);

Name := Planet - Population Rebel
Is Negative When := true
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Space import Planet;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Space import Planet;
Target Selector := Galaxy.Current.FindSpaceObjects[Planet]().Where(lambda p: p.Colony != None)
Parameter := PlanetName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Parameter := SectorName = target.Sector.Name;
Action := from FrEee.Game.Objects.Space import Galaxy;
Action := from FrEee.Objects.Space import Galaxy;
Action := target.Colony = source if source != None else Galaxy.Current.CreateNewEmpire();

Name := Planet - Facility Damage
Is Negative When := true
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Space import Planet;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Space import Planet;
Target Selector := Galaxy.Current.FindSpaceObjects[Planet]().Where(lambda p: p.Colony != None)
Parameter := PlanetName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand All @@ -118,8 +118,8 @@ Action := target.Colony.Facilities.PickRandom().Dispose() for num in range(0,

Name := Planet - Cargo Damage
Is Negative When := amount > 0
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Space import Planet;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Space import Planet;
Target Selector := Galaxy.Current.FindSpaceObjects[Planet]().Where(lambda p: p.Colony != None)
Parameter := PlanetName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand All @@ -137,8 +137,8 @@ Action := target.NormalizeStoredResources();

Name := Planet - Plague
Is Negative When := true
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Space import Planet;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Space import Planet;
Target Selector := Galaxy.Current.FindSpaceObjects[Planet]().Where(lambda p: p.Colony != None)
Parameter := PlanetName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand All @@ -147,8 +147,8 @@ Action := # TODO - implement plagues

Name := Planet - Destroyed
Is Negative When := true
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Space import Planet;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Space import Planet;
Target Selector := Galaxy.Current.FindSpaceObjects[Planet]()
Parameter := PlanetName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand All @@ -157,8 +157,8 @@ Action := target.ConvertToAsteroidField();

Name := Star - Destroyed
Is Negative When := true
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Space import Star;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Space import Star;
Target Selector := Galaxy.Current.FindSpaceObjects[Star]()
Parameter := StarName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand All @@ -167,8 +167,8 @@ Action := target.Detonate();

Name := Warp Point - Closed
Is Negative When := true
Import := from FrEee.Game.Objects.Space import Galaxy;
Import := from FrEee.Game.Objects.Space import WarpPoint;
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.Space import WarpPoint;
Target Selector := Galaxy.Current.FindSpaceObjects[WarpPoint]()
Parameter := WarpPointName = target.Name;
Parameter := SystemName = target.StarSystem.Name;
Expand Down
10 changes: 5 additions & 5 deletions FrEee.Assets/GameSetups/Quickstart.gsu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FrEee.Game.Setup.GameSetup, FrEee.Core:
FrEee.Setup.GameSetup, FrEee.Core:
p32:
AllowedTrades:
:All;
Expand All @@ -7,7 +7,7 @@ p32:
EmpirePoints:
:2000;
EmpireTemplates:
System.Collections.Generic.List`1[[FrEee.Game.Setup.EmpireTemplate, FrEee.Core]], System.Private.CoreLib:
System.Collections.Generic.List`1[[FrEee.Setup.EmpireTemplate, FrEee.Core]], System.Private.CoreLib:
c1:
:p10:
AIName:
Expand Down Expand Up @@ -175,14 +175,14 @@ p32:
StartingResources:
:20000;
VictoryConditions:
System.Collections.Generic.List`1[[FrEee.Game.Interfaces.IVictoryCondition, FrEee.Core]], System.Private.CoreLib:
System.Collections.Generic.List`1[[FrEee.Interfaces.IVictoryCondition, FrEee.Core]], System.Private.CoreLib:
c1:
FrEee.Game.Objects.VictoryConditions.TotalEliminationVictoryCondition, FrEee.Core:
FrEee.Objects.VictoryConditions.TotalEliminationVictoryCondition, FrEee.Core:
p0:
;
;
WarpPointPlacementStrategy:
FrEee.Game.Setup.WarpPointPlacementStrategies.EdgeAlignedWarpPointPlacementStrategy, FrEee.Core:
FrEee.Setup.WarpPointPlacementStrategies.EdgeAlignedWarpPointPlacementStrategy, FrEee.Core:
p2:
Description:
:"Places warp points along the edge of the system, aligned with the star systems they lead to.";
Expand Down
4 changes: 2 additions & 2 deletions FrEee.Assets/Scripts/AI/AI_Default/AI.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
clr.ImportExtensions(System.Linq);
import FrEee;
import FrEee.Utility;
from FrEee.Game.Objects.Commands import *;
clr.ImportExtensions(FrEee.Utility.Extensions);
from FrEee.Objects.Commands import *;
clr.ImportExtensions(FrEee.Extensions);
from System import Console;

# alias the domain and context variables to avoid confusion
Expand Down
6 changes: 3 additions & 3 deletions FrEee.Assets/Scripts/AI/Vanguard/AI.csx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#load "Plan.csx"

#r "../../../bin/Debug/FrEee.Core.dll"
using FrEee.Game.Objects.Civilization;
using FrEee.Game.Objects.Space;
using FrEee.Objects.Civilization;
using FrEee.Objects.Space;
using System;
using System.Linq;
using FrEee.Utility.Extensions;
using FrEee.Extensions;


//Note, at present, classes within scripts cannot be stored in the AI Notes as classes.
Expand Down
6 changes: 3 additions & 3 deletions FrEee.Assets/Scripts/AI/Vanguard/BasicResearchModule.csx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#r "../../../bin/Debug/FrEee.Core.dll"
using FrEee.Game.Objects.Civilization;
using FrEee.Game.Objects.Space;
using FrEee.Game.Objects.Commands;
using FrEee.Objects.Civilization;
using FrEee.Objects.Space;
using FrEee.Objects.Commands;
using System.Linq;
/// <summary>
/// Class that will issue basic research commands.
Expand Down
12 changes: 6 additions & 6 deletions FrEee.Assets/Scripts/AI/Vanguard/MinistryOfColonization.csx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#r "../../../bin/Debug/FrEee.Core.dll"
#load "Plan.csx"
using FrEee.Game.Objects.Civilization;
using FrEee.Game.Objects.Space;
using FrEee.Utility;
using FrEee.Objects.Civilization;
using FrEee.Objects.Space;
using FrEee.Utility; using FrEee.Serialization;
using System;
using System.Linq;
using System.Collections.Generic;
using FrEee.Game.Objects.Vehicles;
using FrEee.Game.Objects.Orders;
using FrEee.Utility.Extensions;
using FrEee.Objects.Vehicles;
using FrEee.Objects.Orders;
using FrEee.Extensions;

/// <summary>
/// Class devoted to the colonization of worlds.
Expand Down
20 changes: 10 additions & 10 deletions FrEee.Assets/Scripts/AI/Vanguard/MinistryOfConstruction.csx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#r "../../../bin/Debug/FrEee.Core.dll"
#load "Plan.csx"
using FrEee.Game.Objects.Civilization;
using FrEee.Game.Objects.Space;
using FrEee.Utility;
using FrEee.Objects.Civilization;
using FrEee.Objects.Space;
using FrEee.Utility; using FrEee.Serialization;
using System;
using System.Linq;
using FrEee.Game.Objects.Orders;
using FrEee.Game.Objects.Vehicles;
using FrEee.Game.Interfaces;
using FrEee.Utility.Extensions;
using FrEee.Game.Objects.Commands;
using FrEee.Game.Objects.LogMessages;
using FrEee.Objects.Orders;
using FrEee.Objects.Vehicles;
using FrEee.Interfaces;
using FrEee.Extensions;
using FrEee.Objects.Commands;
using FrEee.Objects.LogMessages;


/// <summary>
Expand All @@ -30,7 +30,7 @@ public class MinistryOfConstruction
public void HandleNewlyConstructedShips(Empire empire, Galaxy galaxy)
{

var completedShips = empire.Log.Where(x => x.LogMessageType == FrEee.Game.Objects.LogMessages.LogMessageType.ConstructionComplete
var completedShips = empire.Log.Where(x => x.LogMessageType == FrEee.Objects.LogMessages.LogMessageType.ConstructionComplete
&& x.TurnNumber == Galaxy.Current.TurnNumber);
foreach(var shiplog in completedShips)
{
Expand Down
18 changes: 9 additions & 9 deletions FrEee.Assets/Scripts/AI/Vanguard/MinistryOfInfrastructure.csx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#r "../../../bin/Debug/FrEee.Core.dll"
#load "Plan.csx"
using FrEee.Game.Objects.Civilization;
using FrEee.Game.Objects.Space;
using FrEee.Utility;
using FrEee.Objects.Civilization;
using FrEee.Objects.Space;
using FrEee.Utility; using FrEee.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using FrEee.Game.Objects.Orders;
using FrEee.Game.Objects.Vehicles;
using FrEee.Game.Interfaces;
using FrEee.Utility.Extensions;
using FrEee.Game.Objects.Commands;
using FrEee.Game.Objects.Technology;
using FrEee.Objects.Orders;
using FrEee.Objects.Vehicles;
using FrEee.Interfaces;
using FrEee.Extensions;
using FrEee.Objects.Commands;
using FrEee.Objects.Technology;


/// <summary>
Expand Down
12 changes: 6 additions & 6 deletions FrEee.Assets/Scripts/AI/Vanguard/MinistryOfShipDesign.csx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#r "../../../bin/Debug/FrEee.Core.dll"
using FrEee.Game.Objects.Civilization;
using FrEee.Game.Objects.Space;
using FrEee.Objects.Civilization;
using FrEee.Objects.Space;
using FrEee.Modding.Templates;
using FrEee.Game.Interfaces;
using FrEee.Utility.Extensions;
using FrEee.Game.Objects.Vehicles;
using FrEee.Interfaces;
using FrEee.Extensions;
using FrEee.Objects.Vehicles;
using System.Linq;

/// <summary>
Expand Down Expand Up @@ -65,7 +65,7 @@ public class MinistryOfShipDesign

var engine = GetLatestEngine();

var hulls = Empire.UnlockedItems.OfType<IHull>().Where(x => x.VehicleType == FrEee.Game.Enumerations.VehicleTypes.Ship && !x.IsObsolete);
var hulls = Empire.UnlockedItems.OfType<IHull>().Where(x => x.VehicleType == FrEee.Enumerations.VehicleTypes.Ship && !x.IsObsolete);

var chosenhull = (from hull in hulls
where hull.Size > (lifeSupport.Size * hull.MinLifeSupport)
Expand Down
12 changes: 6 additions & 6 deletions FrEee.Assets/Scripts/AI/Vanguard/Plan.csx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#r "../../../bin/Debug/FrEee.Core.dll"
using FrEee.Game.Objects.Civilization;
using FrEee.Game.Objects.Space;
using FrEee.Utility;
using FrEee.Objects.Civilization;
using FrEee.Objects.Space;
using FrEee.Utility; using FrEee.Serialization;
using System;
using System.Collections.Generic;
using FrEee.Utility.Extensions;
using FrEee.Game.Objects.Orders;
using FrEee.Game.Objects.Vehicles;
using FrEee.Extensions;
using FrEee.Objects.Orders;
using FrEee.Objects.Vehicles;
using System.Linq;

public static class PlanManager
Expand Down
10 changes: 5 additions & 5 deletions FrEee.Tests/Modding/FormulaTest.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using FrEee.Game.Objects.Civilization;
using FrEee.Game.Objects.Combat;
using FrEee.Game.Objects.Space;
using FrEee.Game.Objects.Technology;
using FrEee.Game.Objects.Vehicles;
using FrEee.Objects.Civilization;
using FrEee.Objects.Combat;
using FrEee.Objects.Space;
using FrEee.Objects.Technology;
using FrEee.Objects.Vehicles;
using FrEee.Modding;
using FrEee.Modding.Templates;
using NUnit.Framework;
Expand Down
2 changes: 1 addition & 1 deletion FrEee.Tests/Modding/Loaders/ComponentLoaderTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using FrEee.Modding;
using FrEee.Utility.Extensions;
using FrEee.Extensions;
using NUnit.Framework;

namespace FrEee.Tests.Modding.Loaders
Expand Down
Loading

0 comments on commit 583f5a3

Please sign in to comment.