Skip to content

Commit 09b5d6a

Browse files
committed
rename EventBase -> EventDescriptor
1 parent 6582e4e commit 09b5d6a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+232
-230
lines changed

Framework/Intersect.Framework.Core/Descriptors/GameObjectType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public enum GameObjectType
4545
[GameObjectInfo(typeof(MapBase), "maps")]
4646
Map,
4747

48-
[GameObjectInfo(typeof(EventBase), "events")]
48+
[GameObjectInfo(typeof(EventDescriptor), "events")]
4949
Event,
5050

5151
[GameObjectInfo(typeof(PlayerVariableDescriptor), "player_variables")]

Framework/Intersect.Framework.Core/GameObjects/Crafting/CraftingRecipeDescriptor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public string IngredientsJson
5555

5656
[NotMapped]
5757
[JsonIgnore]
58-
public EventBase Event
58+
public EventDescriptor Event
5959
{
60-
get => EventBase.Get(EventId);
60+
get => EventDescriptor.Get(EventId);
6161
set => EventId = value?.Id ?? Guid.Empty;
6262
}
6363

Framework/Intersect.Framework.Core/GameObjects/Events/EventBase.cs renamed to Framework/Intersect.Framework.Core/GameObjects/Events/EventDescriptor.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Intersect.Framework.Core.GameObjects.Events;
77

8-
public partial class EventBase : DatabaseObject<EventBase>, IFolderable
8+
public partial class EventDescriptor : DatabaseObject<EventDescriptor>, IFolderable
99
{
1010
//Cached Pages Data
1111
private string mCachedPagesData = null;
@@ -14,12 +14,12 @@ public partial class EventBase : DatabaseObject<EventBase>, IFolderable
1414
private List<EventPage> mPages = [];
1515

1616
//EF Parameterless Constructor
17-
public EventBase()
17+
public EventDescriptor()
1818
{
1919
}
2020

2121
[JsonConstructor]
22-
public EventBase(Guid id, Guid mapId, int x, int y, bool isCommon = false, bool isGlobal = false) : base(id)
22+
public EventDescriptor(Guid id, Guid mapId, int x, int y, bool isCommon = false, bool isGlobal = false) : base(id)
2323
{
2424
Name = "New Event";
2525
MapId = mapId;
@@ -35,22 +35,22 @@ public EventBase(Guid id, Guid mapId, int x, int y, bool isCommon = false, bool
3535
Pages = [new()];
3636
}
3737

38-
public EventBase(Guid id, bool isCommon = false) : base(id)
38+
public EventDescriptor(Guid id, bool isCommon = false) : base(id)
3939
{
4040
Name = "New Event";
4141
Pages = [];
4242
CommonEvent = isCommon;
4343
}
4444

45-
public EventBase(Guid id, EventBase copy) : base(id)
45+
public EventDescriptor(Guid id, EventDescriptor copy) : base(id)
4646
{
4747
Name = "New Event";
4848
Pages = [];
4949
Load(copy.JsonData);
5050
CommonEvent = copy.CommonEvent;
5151
}
5252

53-
public EventBase(Guid id, string json, bool isCommon = false) : base(id)
53+
public EventDescriptor(Guid id, string json, bool isCommon = false) : base(id)
5454
{
5555
Name = "New Event";
5656
CommonEvent = isCommon;
@@ -110,13 +110,13 @@ public List<EventPage> Pages
110110
}
111111
}
112112

113-
public new static string[] Names => Lookup.Where(pair => ((EventBase) pair.Value)?.CommonEvent ?? false)
113+
public new static string[] Names => Lookup.Where(pair => ((EventDescriptor) pair.Value)?.CommonEvent ?? false)
114114
.OrderBy(p => p.Value?.Name)
115115
.Select(pair => pair.Value?.Name ?? Deleted)
116116
.ToArray();
117117

118118
public new static KeyValuePair<Guid, string>[] ItemPairs => Lookup
119-
.Where(pair => ((EventBase) pair.Value)?.CommonEvent ?? false)
119+
.Where(pair => ((EventDescriptor) pair.Value)?.CommonEvent ?? false)
120120
.OrderBy(p => p.Value?.Name)
121121
.Select(pair => new KeyValuePair<Guid, string>(pair.Key, pair.Value?.Name ?? Deleted))
122122
.ToArray();
@@ -143,7 +143,7 @@ public List<EventPage> Pages
143143
return Guid.Empty;
144144
}
145145

146-
var commonEvents = Lookup.Where(pair => ((EventBase) pair.Value)?.CommonEvent ?? false)
146+
var commonEvents = Lookup.Where(pair => ((EventDescriptor) pair.Value)?.CommonEvent ?? false)
147147
.OrderBy(p => p.Value?.Name)
148148
.ToArray();
149149

@@ -155,14 +155,14 @@ public List<EventPage> Pages
155155
return commonEvents[listIndex].Value?.Id ?? Guid.Empty;
156156
}
157157

158-
public static new EventBase FromList(int listIndex)
158+
public static new EventDescriptor FromList(int listIndex)
159159
{
160160
return Get(IdFromList(listIndex));
161161
}
162162

163163
public static new int ListIndex(Guid id)
164164
{
165-
var commonEvents = Lookup.Where(pair => ((EventBase) pair.Value)?.CommonEvent ?? false)
165+
var commonEvents = Lookup.Where(pair => ((EventDescriptor) pair.Value)?.CommonEvent ?? false)
166166
.OrderBy(p => p.Value?.Name)
167167
.ToArray();
168168

Framework/Intersect.Framework.Core/GameObjects/ItemBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ public SpellBase Spell
162162

163163
[NotMapped]
164164
[JsonIgnore]
165-
public EventBase Event
165+
public EventDescriptor Event
166166
{
167-
get => EventBase.Get(EventId);
167+
get => EventDescriptor.Get(EventId);
168168
set => EventId = value?.Id ?? Guid.Empty;
169169
}
170170

@@ -340,14 +340,14 @@ public string EventTriggersJson
340340
set => EventTriggers = JsonConvert.DeserializeObject<Dictionary<ItemEventTrigger, Guid>>(value ?? string.Empty) ?? new Dictionary<ItemEventTrigger, Guid>();
341341
}
342342

343-
public EventBase? GetEventTrigger(ItemEventTrigger eventTrigger)
343+
public EventDescriptor? GetEventTrigger(ItemEventTrigger eventTrigger)
344344
{
345345
if (!EventTriggers.TryGetValue(eventTrigger, out var trigger))
346346
{
347347
return null;
348348
}
349349

350-
return EventBase.Get(trigger);
350+
return EventDescriptor.Get(trigger);
351351
}
352352

353353
[NotMapped, JsonIgnore]

Framework/Intersect.Framework.Core/GameObjects/Maps/MapBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public partial class MapBase : DatabaseObject<MapBase>
2424

2525
[NotMapped]
2626
[JsonIgnore]
27-
public readonly Dictionary<Guid, EventBase> LocalEvents = new();
27+
public readonly Dictionary<Guid, EventDescriptor> LocalEvents = new();
2828

2929
//Client/Editor Only
3030
[JsonIgnore]
@@ -149,7 +149,7 @@ public MapBase(MapBase mapBase) : base(mapBase?.Id ?? Guid.Empty)
149149

150150
foreach (var record in mapBase.LocalEvents)
151151
{
152-
var evt = new EventBase(record.Key, record.Value?.JsonData)
152+
var evt = new EventDescriptor(record.Key, record.Value?.JsonData)
153153
{
154154
MapId = Id,
155155
};

Framework/Intersect.Framework.Core/GameObjects/NpcBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ public string PlayerCanAttackConditionsJson
204204

205205
[NotMapped]
206206
[JsonIgnore]
207-
public EventBase OnDeathEvent
207+
public EventDescriptor OnDeathEvent
208208
{
209-
get => EventBase.Get(OnDeathEventId);
209+
get => EventDescriptor.Get(OnDeathEventId);
210210
set => OnDeathEventId = value?.Id ?? Guid.Empty;
211211
}
212212

@@ -215,9 +215,9 @@ public EventBase OnDeathEvent
215215

216216
[NotMapped]
217217
[JsonIgnore]
218-
public EventBase OnDeathPartyEvent
218+
public EventDescriptor OnDeathPartyEvent
219219
{
220-
get => EventBase.Get(OnDeathPartyEventId);
220+
get => EventDescriptor.Get(OnDeathPartyEventId);
221221
set => OnDeathPartyEventId = value?.Id ?? Guid.Empty;
222222
}
223223

Framework/Intersect.Framework.Core/GameObjects/QuestBase.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public partial class QuestBase : DatabaseObject<QuestBase>, IFolderable
3939
[NotMapped]
4040
[JsonIgnore]
4141
//Events that need to be added for the quest, int is task id
42-
public Dictionary<Guid, EventBase> AddEvents { get; set; } = [];
42+
public Dictionary<Guid, EventDescriptor> AddEvents { get; set; } = [];
4343

4444
[NotMapped]
4545
//Events that need to be removed for the quest
@@ -94,9 +94,9 @@ public string JsonRequirements
9494

9595
[NotMapped]
9696
[JsonIgnore]
97-
public EventBase StartEvent
97+
public EventDescriptor StartEvent
9898
{
99-
get => EventBase.Get(StartEventId);
99+
get => EventDescriptor.Get(StartEventId);
100100
set => StartEventId = value.Id;
101101
}
102102

@@ -105,9 +105,9 @@ public EventBase StartEvent
105105

106106
[NotMapped]
107107
[JsonIgnore]
108-
public EventBase EndEvent
108+
public EventDescriptor EndEvent
109109
{
110-
get => EventBase.Get(EndEventId);
110+
get => EventDescriptor.Get(EndEventId);
111111
set => EndEventId = value.Id;
112112
}
113113

@@ -207,7 +207,7 @@ public partial class QuestTask
207207
{
208208
[NotMapped]
209209
[JsonIgnore]
210-
public EventBase EditingEvent;
210+
public EventDescriptor EditingEvent;
211211

212212
public QuestTask(Guid id)
213213
{
@@ -219,9 +219,9 @@ public QuestTask(Guid id)
219219
public Guid CompletionEventId { get; set; }
220220

221221
[JsonIgnore]
222-
public EventBase CompletionEvent
222+
public EventDescriptor CompletionEvent
223223
{
224-
get => EventBase.Get(CompletionEventId);
224+
get => EventDescriptor.Get(CompletionEventId);
225225
set => CompletionEventId = value.Id;
226226
}
227227

Framework/Intersect.Framework.Core/GameObjects/ResourceBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ public string JsonHarvestingRequirements
9191

9292
[NotMapped]
9393
[JsonIgnore]
94-
public EventBase Event
94+
public EventDescriptor Event
9595
{
96-
get => EventBase.Get(EventId);
96+
get => EventDescriptor.Get(EventId);
9797
set => EventId = value?.Id ?? Guid.Empty;
9898
}
9999

Framework/Intersect.Framework.Core/GameObjects/SpellBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ public string JsonCastRequirements
125125

126126
[NotMapped]
127127
[JsonIgnore]
128-
public EventBase Event
128+
public EventDescriptor Event
129129
{
130-
get => EventBase.Get(EventId);
130+
get => EventDescriptor.Get(EventId);
131131
set => EventId = value?.Id ?? Guid.Empty;
132132
}
133133

Intersect.Editor/Forms/DockingElements/frmMapEditor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ private void picMap_MouseDown(object sender, MouseEventArgs e)
468468
}
469469
else if (Globals.CurrentLayer == LayerOptions.Events)
470470
{
471-
EventBase tmpEvent;
471+
EventDescriptor tmpEvent;
472472
if ((tmpEvent = Globals.CurrentMap.FindEventAt(Globals.CurTileX, Globals.CurTileY)) != null)
473473
{
474474
Globals.CurrentMap.LocalEvents.Remove(tmpEvent.Id);
@@ -1215,7 +1215,7 @@ private void picMap_DoubleClick(object sender, EventArgs e)
12151215
FrmEvent tmpEventEditor;
12161216
if (tmpEvent == null)
12171217
{
1218-
tmpEvent = new EventBase(
1218+
tmpEvent = new EventDescriptor(
12191219
Guid.NewGuid(), Globals.CurrentMap.Id, Globals.CurTileX, Globals.CurTileY
12201220
);
12211221

@@ -1903,7 +1903,7 @@ public void ProcessSelectionMovement(MapInstance tmpMap, bool ignoreMouse = fals
19031903
}
19041904

19051905
//Events
1906-
EventBase eventCopy;
1906+
EventDescriptor eventCopy;
19071907
if (Globals.SelectionType != (int)SelectionTypes.CurrentLayer ||
19081908
Globals.CurrentLayer == LayerOptions.Events)
19091909
{
@@ -1919,7 +1919,7 @@ public void ProcessSelectionMovement(MapInstance tmpMap, bool ignoreMouse = fals
19191919
tmpMap.LocalEvents.Remove(eventOnTemporaryMap.Id);
19201920
}
19211921

1922-
eventCopy = new EventBase(
1922+
eventCopy = new EventDescriptor(
19231923
Guid.NewGuid(),
19241924
eventAtPosition
19251925
)

0 commit comments

Comments
 (0)