This repository has been archived by the owner on Jun 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a mode switch for block type processing. Now can process enforcement based on either block type or block subtype.
- Loading branch information
1 parent
5076369
commit d990e0d
Showing
4 changed files
with
90 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
//2363 | ||
//2381 | ||
// | ||
// This code was generated by a tool. Any changes made manually will be lost | ||
// the next time this code is regenerated. | ||
// | ||
|
||
using System.Reflection; | ||
|
||
[assembly: AssemblyFileVersion("1.10.0.2363")] | ||
[assembly: AssemblyVersion("1.10.0.2363")] | ||
[assembly: AssemblyFileVersion("1.11.0.2381")] | ||
[assembly: AssemblyVersion("1.11.0.2381")] |
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
58 changes: 41 additions & 17 deletions
58
EssentialsPlugin/Settings/SettingsBlockEnforcementItem.cs
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,40 +1,64 @@ | ||
namespace EssentialsPlugin.Settings | ||
{ | ||
using System; | ||
|
||
public class SettingsBlockEnforcementItem | ||
{ | ||
private bool enabled; | ||
public bool Enabled | ||
public enum EnforcementMode | ||
{ | ||
Off = 0, | ||
BlockId = 1, | ||
BlockSubtypeId = 2 | ||
} | ||
|
||
private string _blockTypeId; | ||
public string BlockTypeId | ||
{ | ||
get { return enabled; } | ||
set { enabled = value; } | ||
get { return _blockTypeId; } | ||
set { _blockTypeId = value; } | ||
} | ||
|
||
private string blockType; | ||
public string BlockType | ||
private string _blockSubtypeId; | ||
|
||
public string BlockSubtypeId | ||
{ | ||
get { return blockType; } | ||
set { blockType = value; } | ||
get { return _blockSubtypeId; } | ||
set { _blockSubtypeId = value; } | ||
} | ||
|
||
private int maxPerGrid; | ||
private int _maxPerGrid; | ||
public int MaxPerGrid | ||
{ | ||
get { return maxPerGrid; } | ||
set { maxPerGrid = value; } | ||
get { return _maxPerGrid; } | ||
set { _maxPerGrid = value; } | ||
} | ||
|
||
private string maxReachWarning; | ||
private string _maxReachWarning; | ||
public string MaxReachWarning | ||
{ | ||
get { return maxReachWarning; } | ||
set { maxReachWarning = value; } | ||
get { return _maxReachWarning; } | ||
set { _maxReachWarning = value; } | ||
} | ||
|
||
private string maxExceedWarning; | ||
private string _maxExceedWarning; | ||
private EnforcementMode _mode; | ||
|
||
public string MaxExceedWarning | ||
{ | ||
get { return maxExceedWarning; } | ||
set { maxExceedWarning = value; } | ||
get { return _maxExceedWarning; } | ||
set { _maxExceedWarning = value; } | ||
} | ||
|
||
public EnforcementMode Mode | ||
{ | ||
get { return _mode; } | ||
set { _mode = value; } | ||
} | ||
|
||
public override int GetHashCode( ) | ||
{ | ||
return ( string.IsNullOrEmpty( _blockSubtypeId ) ? string.Empty : _blockSubtypeId ).GetHashCode( ) | ||
+ ( string.IsNullOrEmpty( _blockTypeId ) ? string.Empty : _blockTypeId ).GetHashCode( ); | ||
} | ||
} | ||
} |