Skip to content

Commit

Permalink
Refactor interfaces and enumerations into appropriate namespaces (#301)
Browse files Browse the repository at this point in the history
* Refactor interfaces from FrEee.Interfaces namespace out to appropriate namespaces to eliminate the spiderweb of a namespace

* Split up FrEee.Enumerations too

* Move FrEee.Modding.Interfaces and FrEee.Modding.Enumerations as well
  • Loading branch information
ekolis committed Feb 10, 2024
1 parent 19b49e3 commit 3ad0c11
Show file tree
Hide file tree
Showing 478 changed files with 7,966 additions and 7,958 deletions.
32 changes: 16 additions & 16 deletions FrEee.Assets/Data/EventTypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ EVENT TYPES DATA FILE

Name := Ship - Damage
Is Negative When := amount > 0
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.GameState import Galaxy;
Import := from FrEee.Objects.Vehicles import SpaceVehicle;
Import := from FrEee.Interfaces import IUnit;
Import := from FrEee.Interfaces import IVehicle;
Expand All @@ -20,7 +20,7 @@ Action := target.TakeDamage("Skips All Shields", amount);

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

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

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

Name := Ship - Moved
Is Negative When := true
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.GameState import Galaxy;
Import := from FrEee.Objects.Vehicles import SpaceVehicle;
Import := from FrEee.Interfaces import IUnit;
Import := from FrEee.Interfaces import IVehicle;
Expand All @@ -62,7 +62,7 @@ Action := target.Sector = Galaxy.Current.PickRandomSector();

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

Name := Planet - Value Change
Is Negative When := amount < 0
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.GameState import Galaxy;
Import := from FrEee.Objects.Space import Planet;
Import := from FrEee.Interfaces import IUnit;
Import := from FrEee.Utility import Resource;
Expand All @@ -87,7 +87,7 @@ Action := target.Value[Resource.Radioactives] += amount;

Name := Planet - Population Change
Is Negative When := amount < 0
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.GameState 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;
Expand All @@ -97,18 +97,18 @@ Action := target.Colony.ChangePopulation(amount);

Name := Planet - Population Rebel
Is Negative When := true
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.GameState 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.Objects.Space import Galaxy;
Action := from FrEee.Objects.GameState import Galaxy;
Action := target.Colony = source if source != None else Galaxy.Current.CreateNewEmpire();

Name := Planet - Facility Damage
Is Negative When := true
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.GameState 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;
Expand All @@ -118,7 +118,7 @@ Action := target.Colony.Facilities.PickRandom().Dispose() for num in range(0,

Name := Planet - Cargo Damage
Is Negative When := amount > 0
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.GameState 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;
Expand All @@ -137,7 +137,7 @@ Action := target.NormalizeStoredResources();

Name := Planet - Plague
Is Negative When := true
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.GameState 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;
Expand All @@ -147,7 +147,7 @@ Action := # TODO - implement plagues

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

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

Name := Warp Point - Closed
Is Negative When := true
Import := from FrEee.Objects.Space import Galaxy;
Import := from FrEee.Objects.GameState import Galaxy;
Import := from FrEee.Objects.Space import WarpPoint;
Target Selector := Galaxy.Current.FindSpaceObjects[WarpPoint]()
Parameter := WarpPointName = target.Name;
Expand Down
97 changes: 48 additions & 49 deletions FrEee.Assets/GameSetups/Quickstart.gsu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FrEee.Setup.GameSetup, FrEee.Core:
p32:
p31:
AllowedTrades:
:All;
EmpirePlacement:
Expand All @@ -11,78 +11,79 @@ p32:
c1:
:p10:
AIName:
:"";
:"AI_Default";
Color:
:255,85,170,255;
:255,85,85,0;
CultureName:
:"Scientists";
:"Warriors";
InsigniaName:
:"Eee";
:"XiChung";
IsPlayerEmpire:
:True;
LeaderName:
:"Emperor Aeiou";
:"Queen Zebu";
LeaderPortraitName:
:"Eee";
:"XiChung";
Name:
:"Eee Consortium";
:"Xi'Chung Hive";
PrimaryRace:
:p7:
Aptitudes:
FrEee.Utility.SafeDictionary`2[[System.String, System.Private.CoreLib],[System.Int32, System.Private.CoreLib]], FrEee.Core:
d15:
:"Physical Strength";
:50;
:"Intelligence";
:135;
:"Reproduction";
:100;
:"Refining Aptitude";
:100;
:"Mining Aptitude";
:100;
:"Cunning";
:50;
:100;
:"Environmental Resistance";
:100;
:"Reproduction";
:110;
:"Defensiveness";
:100;
:"Construction Aptitude";
:100;
:"Maintenance Aptitude";
:100;
:"Happiness";
:120;
:"Aggressiveness";
:100;
:"Defensiveness";
:103;
:"Political Savvy";
:50;
:"Mining Aptitude";
:110;
:"Farming Aptitude";
:80;
:"Refining Aptitude";
:110;
:"Construction Aptitude";
:100;
:"Political Savvy";
:100;
:"Repair Aptitude";
:100;
:"Maintenance Aptitude";
:"Intelligence";
:100;
:"Aggressiveness";
:100;
:"Physical Strength";
:100;
;
happinessModel:
:p1:
ID:
:"Peaceful";
:"HappinessModel Peaceful";
;
Name:
:"Eee";
:"Xi'Chung";
NativeAtmosphere:
:"Oxygen";
:"Hydrogen";
NativeSurface:
:"Gas Giant";
:"Ice";
PopulationIconName:
:"Eee";
:"XiChung";
TraitNames:
System.Collections.Generic.List`1[[System.String, System.Private.CoreLib]], System.Private.CoreLib:
c1:
:"Temporal Knowledge";
c2:
:"Propulsion Experts";
:"Advanced Storage Techniques";
;
;
ShipsetName:
:"Eee";
:"XiChung";
;
;
ForbiddenTechnologyNames:
Expand All @@ -104,25 +105,25 @@ p32:
ConstructionAbilityID:
:"0";
MaxCargo:
:16000;
:8000;
MaxCargoDomed:
:1000;
:800;
MaxFacilities:
:25;
:20;
MaxFacilitiesDomed:
:5;
:4;
MaxPopulation:
:8000000000;
:4000000000;
MaxPopulationDomed:
:500000000;
:400000000;
ModID:
:"StellarObjectSize Huge";
:"StellarObjectSize Large";
Name:
:"Huge";
:"Large";
StellarObjectType:
:"Planet";
StellarSize:
:Huge;
:Large;
;
HomeworldsPerEmpire:
:1;
Expand All @@ -144,8 +145,6 @@ p32:
:150;
MinSpawnedAsteroidValue:
:50;
RandomAIs:
:5;
RemoteMiningModel:
:p3:
ValueBonus:
Expand All @@ -158,7 +157,7 @@ p32:
ResourceStorage:
:50000;
Seed:
:796844;
:3238972;
StandardMiningModel:
:p2:
ValueBonus:
Expand All @@ -175,7 +174,7 @@ p32:
StartingResources:
:20000;
VictoryConditions:
System.Collections.Generic.List`1[[FrEee.Interfaces.IVictoryCondition, FrEee.Core]], System.Private.CoreLib:
System.Collections.Generic.List`1[[FrEee.Objects.VictoryConditions.IVictoryCondition, FrEee.Core]], System.Private.CoreLib:
c1:
FrEee.Objects.VictoryConditions.TotalEliminationVictoryCondition, FrEee.Core:
p0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using System;
using System.Linq;
using System.Collections.Generic;
using FrEee.Objects.Vehicles;
using FrEee.Objects.Orders;
using FrEee.Objects.Civilization.Orders;
using FrEee.Extensions;

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions FrEee.Assets/Scripts/AI/Vanguard/MinistryOfConstruction.csx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ using FrEee.Objects.Space;
using FrEee.Utility; using FrEee.Serialization;
using System;
using System.Linq;
using FrEee.Objects.Orders;
using FrEee.Objects.Civilization.Orders;
using FrEee.Objects.Vehicles;
using FrEee.Interfaces;

using FrEee.Extensions;
using FrEee.Objects.Commands;
using FrEee.Objects.LogMessages;
Expand Down
4 changes: 2 additions & 2 deletions FrEee.Assets/Scripts/AI/Vanguard/MinistryOfInfrastructure.csx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ using FrEee.Utility; using FrEee.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using FrEee.Objects.Orders;
using FrEee.Objects.Civilization.Orders;
using FrEee.Objects.Vehicles;
using FrEee.Interfaces;

using FrEee.Extensions;
using FrEee.Objects.Commands;
using FrEee.Objects.Technology;
Expand Down
2 changes: 1 addition & 1 deletion FrEee.Assets/Scripts/AI/Vanguard/MinistryOfShipDesign.csx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using FrEee.Objects.Civilization;
using FrEee.Objects.Space;
using FrEee.Modding.Templates;
using FrEee.Interfaces;

using FrEee.Extensions;
using FrEee.Objects.Vehicles;
using System.Linq;
Expand Down
2 changes: 1 addition & 1 deletion FrEee.Assets/Scripts/AI/Vanguard/Plan.csx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using FrEee.Utility; using FrEee.Serialization;
using System;
using System.Collections.Generic;
using FrEee.Extensions;
using FrEee.Objects.Orders;
using FrEee.Objects.Civilization.Orders;
using FrEee.Objects.Vehicles;
using System.Linq;

Expand Down
2 changes: 1 addition & 1 deletion FrEee.Tests/Modding/FormulaTest.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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;
using System.Collections.Generic;
using System.Linq;
using FrEee.Objects.GameState;

namespace FrEee.Tests.Modding;

Expand Down
Loading

0 comments on commit 3ad0c11

Please sign in to comment.