Skip to content

Commit

Permalink
Use file-scoped namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalobi committed Mar 13, 2024
1 parent a6b9292 commit d006079
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 68 deletions.
22 changes: 11 additions & 11 deletions CelesteMod/Source/CelesteModExports.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using MonoMod.ModInterop;

namespace Celeste.Mod.CelesteMod {
/// <summary>
/// Provides export functions for other mods to import.
/// If you do not need to export any functions, delete this class and the corresponding call
/// to ModInterop() in <see cref="CelesteModModule.Load"/>
/// </summary>
[ModExportName("CelesteMod")]
public static class CelesteModExports {
// TODO: add your mod's exports, if required
}
}
namespace Celeste.Mod.CelesteMod;

/// <summary>
/// Provides export functions for other mods to import.
/// If you do not need to export any functions, delete this class and the corresponding call
/// to ModInterop() in <see cref="CelesteModModule.Load"/>
/// </summary>
[ModExportName("CelesteMod")]
public static class CelesteModExports {
// TODO: add your mod's exports, if required
}
24 changes: 12 additions & 12 deletions CelesteMod/Source/CelesteModModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
using MonoMod.ModInterop;
#endif

namespace Celeste.Mod.CelesteMod {
public class CelesteModModule : EverestModule {
public static CelesteModModule Instance { get; private set; }
namespace Celeste.Mod.CelesteMod;

public class CelesteModModule : EverestModule {
public static CelesteModModule Instance { get; private set; }

#if Settings
public override Type SettingsType => typeof(CelesteModModuleSettings);
Expand All @@ -23,8 +24,8 @@ public class CelesteModModule : EverestModule {
public static CelesteModModuleSaveData SaveData => (CelesteModModuleSaveData) Instance._SaveData;

#endif
public CelesteModModule() {
Instance = this;
public CelesteModModule() {
Instance = this;
#if Logging
//-:cnd:noEmit
#if DEBUG
Expand All @@ -36,18 +37,17 @@ public CelesteModModule() {
#endif
//+:cnd:noEmit
#endif
}
}

public override void Load() {
public override void Load() {
#if Exports
typeof(CelesteModExports).ModInterop(); // TODO: delete this line if you do not need to export any functions

#endif
// TODO: apply any hooks that should always be active
}
// TODO: apply any hooks that should always be active
}

public override void Unload() {
public override void Unload() {
// TODO: unapply any hooks applied in Load()
}
}
}
}
8 changes: 4 additions & 4 deletions CelesteMod/Source/CelesteModModuleSaveData.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Celeste.Mod.CelesteMod {
public class CelesteModModuleSaveData : EverestModuleSaveData {
namespace Celeste.Mod.CelesteMod;

}
}
public class CelesteModModuleSaveData : EverestModuleSaveData {

}
8 changes: 4 additions & 4 deletions CelesteMod/Source/CelesteModModuleSession.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Celeste.Mod.CelesteMod {
public class CelesteModModuleSession : EverestModuleSession {
namespace Celeste.Mod.CelesteMod;

}
}
public class CelesteModModuleSession : EverestModuleSession {

}
8 changes: 4 additions & 4 deletions CelesteMod/Source/CelesteModModuleSettings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace Celeste.Mod.CelesteMod {
public class CelesteModModuleSettings : EverestModuleSettings {
namespace Celeste.Mod.CelesteMod;

}
}
public class CelesteModModuleSettings : EverestModuleSettings {

}
16 changes: 8 additions & 8 deletions CelesteMod/Source/Entities/SampleActor.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Celeste.Mod.Entities;
using Microsoft.Xna.Framework;

namespace Celeste.Mod.CelesteMod.Entities {
[CustomEntity("CelesteMod/SampleActor")]
public class SampleActor : Actor {
public SampleActor(EntityData data, Vector2 offset)
: base(data.Position + offset) {
// TODO: read properties from data
}
namespace Celeste.Mod.CelesteMod.Entities;

[CustomEntity("CelesteMod/SampleActor")]
public class SampleActor : Actor {
public SampleActor(EntityData data, Vector2 offset)
: base(data.Position + offset) {
// TODO: read properties from data
}
}
}
20 changes: 10 additions & 10 deletions CelesteMod/Source/Entities/SampleEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
using Microsoft.Xna.Framework;
using Monocle;

namespace Celeste.Mod.CelesteMod.Entities {
[CustomEntity("CelesteMod/SampleEntity")]
public class SampleEntity : Entity {
public SampleEntity(EntityData data, Vector2 offset)
: base(data.Position + offset) {
// TODO: read properties from data
Add(GFX.SpriteBank.Create("sampleEntity"));
Collider = new Hitbox(16, 16, -8, -8);
}
namespace Celeste.Mod.CelesteMod.Entities;

[CustomEntity("CelesteMod/SampleEntity")]
public class SampleEntity : Entity {
public SampleEntity(EntityData data, Vector2 offset)
: base(data.Position + offset) {
// TODO: read properties from data
Add(GFX.SpriteBank.Create("sampleEntity"));
Collider = new Hitbox(16, 16, -8, -8);
}
}
}
16 changes: 8 additions & 8 deletions CelesteMod/Source/Entities/SampleSolid.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Celeste.Mod.Entities;
using Microsoft.Xna.Framework;

namespace Celeste.Mod.CelesteMod.Entities {
[CustomEntity("CelesteMod/SampleSolid")]
public class SampleSolid : Solid {
public SampleSolid(EntityData data, Vector2 offset)
: base(data.Position + offset, data.Width, data.Height, true) {
// TODO: read properties from data
}
namespace Celeste.Mod.CelesteMod.Entities;

[CustomEntity("CelesteMod/SampleSolid")]
public class SampleSolid : Solid {
public SampleSolid(EntityData data, Vector2 offset)
: base(data.Position + offset, data.Width, data.Height, true) {
// TODO: read properties from data
}
}
}
14 changes: 7 additions & 7 deletions CelesteMod/Source/Triggers/SampleTrigger.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Celeste.Mod.Entities;
using Microsoft.Xna.Framework;

namespace Celeste.Mod.CelesteMod.Triggers {
[CustomEntity("CelesteMod/SampleTrigger")]
public class SampleTrigger : Trigger {
public SampleTrigger(EntityData data, Vector2 offset) : base(data, offset) {
// TODO: read properties from data
}
namespace Celeste.Mod.CelesteMod.Triggers;

[CustomEntity("CelesteMod/SampleTrigger")]
public class SampleTrigger : Trigger {
public SampleTrigger(EntityData data, Vector2 offset) : base(data, offset) {
// TODO: read properties from data
}
}
}

0 comments on commit d006079

Please sign in to comment.