-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb7793f
commit 7035548
Showing
49 changed files
with
5,052 additions
and
4,856 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,38 @@ | ||
using System; | ||
|
||
namespace RuriLib.Attributes | ||
namespace RuriLib.Attributes; | ||
|
||
/// <summary> | ||
/// Attribute used to decorate a method that can be turned into an auto block. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Method)] | ||
public class Block : Attribute | ||
{ | ||
/// <summary> | ||
/// Attribute used to decorate a method that can be turned into an auto block. | ||
/// The name of the block. If not specified, a name will be automatically | ||
/// generated from the name of the method. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Method)] | ||
public class Block : Attribute | ||
{ | ||
/// <summary> | ||
/// The name of the block. If not specified, a name will be automatically | ||
/// generated from the name of the method. | ||
/// </summary> | ||
public string name = null; | ||
// ReSharper disable once InconsistentNaming | ||
public string? name = null; | ||
|
||
/// <summary> | ||
/// The description of what the block does. | ||
/// </summary> | ||
public string description = null; | ||
/// <summary> | ||
/// The description of what the block does. | ||
/// </summary> | ||
// ReSharper disable once InconsistentNaming | ||
public string description; | ||
|
||
/// <summary> | ||
/// Any extra information that is too long to fit the short and concise description. | ||
/// </summary> | ||
public string extraInfo = null; | ||
/// <summary> | ||
/// Any extra information that is too long to fit the short and concise description. | ||
/// </summary> | ||
// ReSharper disable once InconsistentNaming | ||
public string? extraInfo = null; | ||
|
||
/// <summary> | ||
/// Creates a <see cref="Block"/> attribute given the <paramref name="description"/> of what the block does. | ||
/// The name of the block will be automatically generated unless explicitly set in the <see cref="name"/> field. | ||
/// </summary> | ||
public Block(string description) | ||
{ | ||
this.description = description; | ||
} | ||
/// <summary> | ||
/// Creates a <see cref="Block"/> attribute given the <paramref name="description"/> of what the block does. | ||
/// The name of the block will be automatically generated unless explicitly set in the <see cref="name"/> field. | ||
/// </summary> | ||
public Block(string description) | ||
{ | ||
this.description = description; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,46 @@ | ||
using System; | ||
|
||
namespace RuriLib.Attributes | ||
namespace RuriLib.Attributes; | ||
|
||
/// <summary> | ||
/// Attribute used to decorate a method that is a block action. The method should take only one | ||
/// parameter of type <see cref="Models.Blocks.BlockInstance"/>. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Method)] | ||
public class BlockAction : Attribute | ||
{ | ||
/// <summary> | ||
/// Attribute used to decorate a method that is a block action. The method should take only one | ||
/// parameter of type <see cref="Models.Blocks.BlockInstance"/>. | ||
/// The name of the action. If not specified, a name will automatically be | ||
/// generated from the name of the method. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Method)] | ||
public class BlockAction : Attribute | ||
{ | ||
/// <summary> | ||
/// The name of the action. If not specified, a name will automatically be | ||
/// generated from the name of the method. | ||
/// </summary> | ||
public string name = null; | ||
// ReSharper disable once InconsistentNaming | ||
public string? name; | ||
|
||
/// <summary> | ||
/// The description of what the action does. | ||
/// </summary> | ||
public string description = null; | ||
/// <summary> | ||
/// The description of what the action does. | ||
/// </summary> | ||
// ReSharper disable once InconsistentNaming | ||
public string? description; | ||
|
||
/// <summary> | ||
/// The id of the block to which this action belongs to. Normally, the | ||
/// id of a block is the name of the method. | ||
/// </summary> | ||
public string parentBlockId = null; | ||
/// <summary> | ||
/// The id of the block to which this action belongs to. Normally, the | ||
/// id of a block is the name of the method. | ||
/// </summary> | ||
// ReSharper disable once InconsistentNaming | ||
public string parentBlockId; | ||
|
||
/// <summary> | ||
/// Defines a block action. | ||
/// </summary> | ||
/// <param name="parentBlockId">The id of the block to which this action belongs to. Normally, the | ||
/// id of a block is the name of the method.</param> | ||
/// <param name="name">The name of the action. If not specified, a name will automatically be | ||
/// generated from the name of the method.</param> | ||
/// <param name="description">The description of what the action does.</param> | ||
public BlockAction(string parentBlockId, string name = null, string description = null) | ||
{ | ||
this.parentBlockId = parentBlockId; | ||
this.name = name; | ||
this.description = description; | ||
} | ||
/// <summary> | ||
/// Defines a block action. | ||
/// </summary> | ||
/// <param name="parentBlockId">The id of the block to which this action belongs to. Normally, the | ||
/// id of a block is the name of the method.</param> | ||
/// <param name="name">The name of the action. If not specified, a name will automatically be | ||
/// generated from the name of the method.</param> | ||
/// <param name="description">The description of what the action does.</param> | ||
public BlockAction(string parentBlockId, string? name = null, string? description = null) | ||
{ | ||
this.parentBlockId = parentBlockId; | ||
this.name = name; | ||
this.description = description; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,47 @@ | ||
using System; | ||
|
||
namespace RuriLib.Attributes | ||
namespace RuriLib.Attributes; | ||
|
||
/// <summary> | ||
/// Attribute used to decorate a class that contains methods decorated with the <see cref="Block"/> attribute. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Class)] | ||
public class BlockCategory : Attribute | ||
{ | ||
/// <summary> | ||
/// Attribute used to decorate a class that contains methods decorated with the <see cref="Block"/> attribute. | ||
/// The name of the category. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Class)] | ||
public class BlockCategory : Attribute | ||
{ | ||
/// <summary> | ||
/// The name of the category. | ||
/// </summary> | ||
public string name = null; | ||
// ReSharper disable once InconsistentNaming | ||
public string name; | ||
|
||
/// <summary> | ||
/// The common features of blocks that are grouped in this category. | ||
/// </summary> | ||
public string description; | ||
/// <summary> | ||
/// The common features of blocks that are grouped in this category. | ||
/// </summary> | ||
// ReSharper disable once InconsistentNaming | ||
public string description; | ||
|
||
/// <summary> | ||
/// The background color of the category when displayed in a UI, as an HTML color string. | ||
/// </summary> | ||
public string backgroundColor; | ||
/// <summary> | ||
/// The background color of the category when displayed in a UI, as an HTML color string. | ||
/// </summary> | ||
// ReSharper disable once InconsistentNaming | ||
public string backgroundColor; | ||
|
||
/// <summary> | ||
/// The foreground color of the category when displayed in a UI, as an HTML color string. | ||
/// </summary> | ||
public string foregroundColor; | ||
/// <summary> | ||
/// The foreground color of the category when displayed in a UI, as an HTML color string. | ||
/// </summary> | ||
// ReSharper disable once InconsistentNaming | ||
public string foregroundColor; | ||
|
||
/// <summary> | ||
/// Creates a <see cref="BlockCategory"/> attribute given its <paramref name="name"/>, | ||
/// <paramref name="description"/> and colors. | ||
/// </summary> | ||
public BlockCategory(string name, string description, string backgroundColor = "#fff", | ||
string foregroundColor = "#000") | ||
{ | ||
this.name = name; | ||
this.description = description; | ||
this.backgroundColor = backgroundColor; | ||
this.foregroundColor = foregroundColor; | ||
} | ||
/// <summary> | ||
/// Creates a <see cref="BlockCategory"/> attribute given its <paramref name="name"/>, | ||
/// <paramref name="description"/> and colors. | ||
/// </summary> | ||
public BlockCategory(string name, string description, string backgroundColor = "#fff", | ||
string foregroundColor = "#000") | ||
{ | ||
this.name = name; | ||
this.description = description; | ||
this.backgroundColor = backgroundColor; | ||
this.foregroundColor = foregroundColor; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
using System; | ||
|
||
namespace RuriLib.Attributes | ||
namespace RuriLib.Attributes; | ||
|
||
/// <summary> | ||
/// Attribute used to decorate a block that can display images. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] | ||
public class BlockImage : Attribute | ||
{ | ||
/// <summary> | ||
/// Attribute used to decorate a block that can display images. | ||
/// The unique id of the image. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] | ||
public class BlockImage : Attribute | ||
{ | ||
/// <summary> | ||
/// The unique id of the image. | ||
/// </summary> | ||
public string id = null; | ||
// ReSharper disable once InconsistentNaming | ||
public string id; | ||
|
||
/// <summary> | ||
/// The max width in pixels. | ||
/// </summary> | ||
public int maxWidth = 300; | ||
/// <summary> | ||
/// The max width in pixels. | ||
/// </summary> | ||
// ReSharper disable once InconsistentNaming | ||
public int maxWidth = 300; | ||
|
||
/// <summary> | ||
/// The max height in pixels. | ||
/// </summary> | ||
public int maxHeight = 300; | ||
/// <summary> | ||
/// The max height in pixels. | ||
/// </summary> | ||
// ReSharper disable once InconsistentNaming | ||
public int maxHeight = 300; | ||
|
||
/// <summary> | ||
/// Defines a block image with a given <paramref name="id"/>. | ||
/// </summary> | ||
public BlockImage(string id) | ||
{ | ||
this.id = id; | ||
} | ||
/// <summary> | ||
/// Defines a block image with a given <paramref name="id"/>. | ||
/// </summary> | ||
public BlockImage(string id) | ||
{ | ||
this.id = id; | ||
} | ||
} |
Oops, something went wrong.