file-scoped namespaces, or The Diff to End All Diffs

This commit is contained in:
Ell 2021-12-23 23:23:56 +01:00
parent e7f00e5c81
commit 1943ccd7a3
3 changed files with 158 additions and 158 deletions

View file

@ -4,10 +4,11 @@ using Microsoft.Xna.Framework;
using TinyLife.Objects;
using TinyLife.World;
namespace ExampleMod {
// note that having a custom class for a furniture item like this is entirely optional
// but it allows for additional functionalities as displayed in this example
public class CustomTable : Furniture {
namespace ExampleMod;
// note that having a custom class for a furniture item like this is entirely optional
// but it allows for additional functionalities as displayed in this example
public class CustomTable : Furniture {
// anything whose base classes have the DataContract attribute automatically gets saved and loaded to and from disk
// this means that you can add custom DataMember members to have them saved and loaded
@ -34,5 +35,4 @@ namespace ExampleMod {
return base.Validate() && this.TestValue <= 1;
}
}
}

View file

@ -13,8 +13,9 @@ using TinyLife.Mods;
using TinyLife.Objects;
using TinyLife.Utilities;
namespace ExampleMod {
public class ExampleMod : Mod {
namespace ExampleMod;
public class ExampleMod : Mod {
// the logger that we can use to log info about this mod
public static Logger Logger { get; private set; }
@ -111,5 +112,4 @@ namespace ExampleMod {
yield return "CustomFurniture";
}
}
}

View file

@ -7,10 +7,11 @@ using TinyLife.Emotions;
using TinyLife.Objects;
using Action = TinyLife.Actions.Action;
namespace ExampleMod {
// we use a multi action because we want to walk to the location, and then execute the main sitting part
// see CustomTable for information on how to store custom action-specific information to disk as well
public class SitDownOnGrassAction : MultiAction {
namespace ExampleMod;
// we use a multi action because we want to walk to the location, and then execute the main sitting part
// see CustomTable for information on how to store custom action-specific information to disk as well
public class SitDownOnGrassAction : MultiAction {
public SitDownOnGrassAction(ActionType type, ActionInfo info) : base(type, info) {
}
@ -51,5 +52,4 @@ namespace ExampleMod {
}
}
}
}