-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split types into their own files in Events
- Loading branch information
Showing
68 changed files
with
1,288 additions
and
1,199 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
Framework/Intersect.Framework.Core/GameObjects/Events/BooleanVariableMod.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Intersect.Enums; | ||
using Newtonsoft.Json; | ||
|
||
namespace Intersect.GameObjects.Events; | ||
|
||
public partial class BooleanVariableMod : VariableMod | ||
{ | ||
public bool Value { get; set; } | ||
|
||
public VariableType DupVariableType { get; set; } = VariableType.PlayerVariable; | ||
|
||
[JsonProperty("DupVariableId")] | ||
public Guid DuplicateVariableId { get; set; } | ||
} |
22 changes: 22 additions & 0 deletions
22
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/AddChatboxTextCommand.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Intersect.Enums; | ||
|
||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
public partial class AddChatboxTextCommand : EventCommand | ||
{ | ||
public override EventCommandType Type { get; } = EventCommandType.AddChatboxText; | ||
|
||
public string Text { get; set; } = string.Empty; | ||
|
||
// TODO: Expose this option to the user? | ||
public ChatMessageType MessageType { get; set; } = ChatMessageType.Notice; | ||
|
||
public string Color { get; set; } = string.Empty; | ||
|
||
public ChatboxChannel Channel { get; set; } = ChatboxChannel.Player; | ||
|
||
public bool ShowChatBubble { get; set; } | ||
|
||
public bool ShowChatBubbleInProximity { get; set; } | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/CastSpellOn.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
public partial class CastSpellOn : EventCommand | ||
{ | ||
public override EventCommandType Type { get; } = EventCommandType.CastSpellOn; | ||
|
||
public Guid SpellId { get; set; } | ||
|
||
public bool Self { get; set; } | ||
|
||
public bool PartyMembers { get; set; } | ||
|
||
public bool GuildMembers { get; set; } | ||
} |
8 changes: 8 additions & 0 deletions
8
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/ChangeFaceCommand.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
public partial class ChangeFaceCommand : EventCommand | ||
{ | ||
public override EventCommandType Type { get; } = EventCommandType.ChangeFace; | ||
|
||
public string Face { get; set; } = string.Empty; | ||
} |
10 changes: 10 additions & 0 deletions
10
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/ChangeGenderCommand.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Intersect.Enums; | ||
|
||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
public partial class ChangeGenderCommand : EventCommand | ||
{ | ||
public override EventCommandType Type { get; } = EventCommandType.ChangeGender; | ||
|
||
public Gender Gender { get; set; } = Gender.Male; | ||
} |
82 changes: 82 additions & 0 deletions
82
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/ChangeItemsCommand.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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
using Intersect.Enums; | ||
|
||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
public partial class ChangeItemsCommand : EventCommand | ||
{ | ||
//For Json Deserialization | ||
public ChangeItemsCommand() | ||
{ | ||
} | ||
|
||
public ChangeItemsCommand(Dictionary<Guid, List<EventCommand>> commandLists) | ||
{ | ||
for (var i = 0; i < BranchIds.Length; i++) | ||
{ | ||
BranchIds[i] = Guid.NewGuid(); | ||
commandLists.Add(BranchIds[i], []); | ||
} | ||
} | ||
|
||
public override EventCommandType Type { get; } = EventCommandType.ChangeItems; | ||
|
||
public Guid ItemId { get; set; } | ||
|
||
public bool Add { get; set; } //If !Add then Remove | ||
|
||
/// <summary> | ||
/// Defines how the server is supposed to handle changing the items of this request. | ||
/// </summary> | ||
public ItemHandling ItemHandling { get; set; } = ItemHandling.Normal; | ||
|
||
/// <summary> | ||
/// Defines whether this event command will use a variable for processing or not. | ||
/// </summary> | ||
public bool UseVariable { get; set; } = false; | ||
|
||
/// <summary> | ||
/// Defines whether the variable used is a Player or Global variable. | ||
/// </summary> | ||
public VariableType VariableType { get; set; } = VariableType.PlayerVariable; | ||
|
||
/// <summary> | ||
/// The Variable Id to use. | ||
/// </summary> | ||
public Guid VariableId { get; set; } | ||
|
||
public int Quantity { get; set; } | ||
|
||
//Branch[0] is the event commands to execute when given/taken successfully, Branch[1] is for when they're not. | ||
public Guid[] BranchIds { get; set; } = new Guid[2]; | ||
|
||
public override string GetCopyData( | ||
Dictionary<Guid, List<EventCommand>> commandLists, | ||
Dictionary<Guid, List<EventCommand>> copyLists | ||
) | ||
{ | ||
foreach (var branch in BranchIds) | ||
{ | ||
if (branch != Guid.Empty && commandLists.ContainsKey(branch)) | ||
{ | ||
copyLists.Add(branch, commandLists[branch]); | ||
foreach (var cmd in commandLists[branch]) | ||
{ | ||
cmd.GetCopyData(commandLists, copyLists); | ||
} | ||
} | ||
} | ||
|
||
return base.GetCopyData(commandLists, copyLists); | ||
} | ||
|
||
public override void FixBranchIds(Dictionary<Guid, Guid> idDict) | ||
{ | ||
for (var i = 0; i < BranchIds.Length; i++) | ||
{ | ||
if (idDict.ContainsKey(BranchIds[i])) | ||
{ | ||
BranchIds[i] = idDict[BranchIds[i]]; | ||
} | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/ChangeLevelCommand.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
public partial class ChangeLevelCommand : EventCommand | ||
{ | ||
public override EventCommandType Type { get; } = EventCommandType.ChangeLevel; | ||
|
||
public int Level { get; set; } | ||
} |
12 changes: 12 additions & 0 deletions
12
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/ChangeNameColorCommand.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
public partial class ChangeNameColorCommand : EventCommand | ||
{ | ||
public override EventCommandType Type { get; } = EventCommandType.ChangeNameColor; | ||
|
||
public Color Color { get; set; } | ||
|
||
public bool Override { get; set; } | ||
|
||
public bool Remove { get; set; } | ||
} |
56 changes: 56 additions & 0 deletions
56
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/ChangeNameCommand.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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
public partial class ChangeNameCommand : EventCommand | ||
{ | ||
//For Json Deserialization | ||
public ChangeNameCommand() | ||
{ | ||
} | ||
|
||
public ChangeNameCommand(Dictionary<Guid, List<EventCommand>> commandLists) | ||
{ | ||
for (var i = 0; i < BranchIds.Length; i++) | ||
{ | ||
BranchIds[i] = Guid.NewGuid(); | ||
commandLists.Add(BranchIds[i], []); | ||
} | ||
} | ||
|
||
public override EventCommandType Type { get; } = EventCommandType.ChangeName; | ||
|
||
public Guid VariableId { get; set; } | ||
|
||
//Branch[0] is the event commands to execute when given/taken successfully, Branch[1] is for when they're not. | ||
public Guid[] BranchIds { get; set; } = new Guid[2]; | ||
|
||
public override string GetCopyData( | ||
Dictionary<Guid, List<EventCommand>> commandLists, | ||
Dictionary<Guid, List<EventCommand>> copyLists | ||
) | ||
{ | ||
foreach (var branch in BranchIds) | ||
{ | ||
if (branch != Guid.Empty && commandLists.ContainsKey(branch)) | ||
{ | ||
copyLists.Add(branch, commandLists[branch]); | ||
foreach (var cmd in commandLists[branch]) | ||
{ | ||
cmd.GetCopyData(commandLists, copyLists); | ||
} | ||
} | ||
} | ||
|
||
return base.GetCopyData(commandLists, copyLists); | ||
} | ||
|
||
public override void FixBranchIds(Dictionary<Guid, Guid> idDict) | ||
{ | ||
for (var i = 0; i < BranchIds.Length; i++) | ||
{ | ||
if (idDict.ContainsKey(BranchIds[i])) | ||
{ | ||
BranchIds[i] = idDict[BranchIds[i]]; | ||
} | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/ChangePlayerColorCommand.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
/// <summary> | ||
/// Defines the Event command partial class for the Change Player Color command. | ||
/// </summary> | ||
public partial class ChangePlayerColorCommand : EventCommand | ||
{ | ||
/// <summary> | ||
/// The <see cref="EventCommandType"/> of this command. | ||
/// </summary> | ||
public override EventCommandType Type { get; } = EventCommandType.ChangePlayerColor; | ||
|
||
/// <summary> | ||
/// The <see cref="Color"/> to apply to the player. | ||
/// </summary> | ||
public Color Color { get; set; } = new(255, 255, 255, 255); | ||
} |
14 changes: 14 additions & 0 deletions
14
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/ChangePlayerLabelCommand.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
public partial class ChangePlayerLabelCommand : EventCommand | ||
{ | ||
public override EventCommandType Type { get; } = EventCommandType.PlayerLabel; | ||
|
||
public string Value { get; set; } | ||
|
||
public int Position { get; set; } //0 = Above Player Name, 1 = Below Player Name | ||
|
||
public Color Color { get; set; } | ||
|
||
public bool MatchNameColor { get; set; } | ||
} |
60 changes: 60 additions & 0 deletions
60
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/ChangeSpellsCommand.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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
public partial class ChangeSpellsCommand : EventCommand | ||
{ | ||
//For Json Deserialization | ||
public ChangeSpellsCommand() | ||
{ | ||
} | ||
|
||
public ChangeSpellsCommand(Dictionary<Guid, List<EventCommand>> commandLists) | ||
{ | ||
for (var i = 0; i < BranchIds.Length; i++) | ||
{ | ||
BranchIds[i] = Guid.NewGuid(); | ||
commandLists.Add(BranchIds[i], []); | ||
} | ||
} | ||
|
||
public override EventCommandType Type { get; } = EventCommandType.ChangeSpells; | ||
|
||
public Guid SpellId { get; set; } | ||
|
||
public bool Add { get; set; } //If !Add then Remove | ||
|
||
public bool RemoveBoundSpell { get; set; } | ||
|
||
//Branch[0] is the event commands to execute when taught/removed successfully, Branch[1] is for when it's not. | ||
public Guid[] BranchIds { get; set; } = new Guid[2]; | ||
|
||
public override string GetCopyData( | ||
Dictionary<Guid, List<EventCommand>> commandLists, | ||
Dictionary<Guid, List<EventCommand>> copyLists | ||
) | ||
{ | ||
foreach (var branch in BranchIds) | ||
{ | ||
if (branch != Guid.Empty && commandLists.ContainsKey(branch)) | ||
{ | ||
copyLists.Add(branch, commandLists[branch]); | ||
foreach (var cmd in commandLists[branch]) | ||
{ | ||
cmd.GetCopyData(commandLists, copyLists); | ||
} | ||
} | ||
} | ||
|
||
return base.GetCopyData(commandLists, copyLists); | ||
} | ||
|
||
public override void FixBranchIds(Dictionary<Guid, Guid> idDict) | ||
{ | ||
for (var i = 0; i < BranchIds.Length; i++) | ||
{ | ||
if (idDict.ContainsKey(BranchIds[i])) | ||
{ | ||
BranchIds[i] = idDict[BranchIds[i]]; | ||
} | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/ChangeSpriteCommand.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
public partial class ChangeSpriteCommand : EventCommand | ||
{ | ||
public override EventCommandType Type { get; } = EventCommandType.ChangeSprite; | ||
|
||
public string Sprite { get; set; } = string.Empty; | ||
} |
10 changes: 10 additions & 0 deletions
10
Framework/Intersect.Framework.Core/GameObjects/Events/Commands/CompleteQuestTaskCommand.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Intersect.GameObjects.Events.Commands; | ||
|
||
public partial class CompleteQuestTaskCommand : EventCommand | ||
{ | ||
public override EventCommandType Type { get; } = EventCommandType.CompleteQuestTask; | ||
|
||
public Guid QuestId { get; set; } | ||
|
||
public Guid TaskId { get; set; } | ||
} |
Oops, something went wrong.