Skip to content

Commit 6561810

Browse files
committed
split and relocate files in GameObjects/Maps
1 parent d45b72c commit 6561810

18 files changed

+371
-326
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Intersect.Enums;
2+
using Intersect.GameObjects.Annotations;
3+
using Intersect.Localization;
4+
5+
namespace Intersect.GameObjects.Maps;
6+
7+
public partial class MapAnimationAttribute : MapAttribute
8+
{
9+
public override MapAttributeType Type => MapAttributeType.Animation;
10+
11+
[EditorLabel("Attributes", "MapAnimation")]
12+
[EditorReference(typeof(AnimationDescriptor), nameof(AnimationDescriptor.Name))]
13+
public Guid AnimationId { get; set; }
14+
15+
[EditorLabel("Attributes", "MapAnimationBlock")]
16+
[EditorBoolean(Style = BooleanStyle.YesNo)]
17+
public bool IsBlock { get; set; }
18+
19+
public override MapAttribute Clone()
20+
{
21+
var att = (MapAnimationAttribute) base.Clone();
22+
att.AnimationId = AnimationId;
23+
att.IsBlock = IsBlock;
24+
25+
return att;
26+
}
27+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Intersect.Enums;
2+
3+
namespace Intersect.GameObjects.Maps;
4+
5+
public partial class MapBlockedAttribute : MapAttribute
6+
{
7+
public override MapAttributeType Type => MapAttributeType.Blocked;
8+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
using Intersect.Enums;
2+
using Intersect.GameObjects.Annotations;
3+
using Intersect.Localization;
4+
5+
namespace Intersect.GameObjects.Maps;
6+
7+
public partial class MapCritterAttribute : MapAttribute
8+
{
9+
public override MapAttributeType Type => MapAttributeType.Critter;
10+
11+
[EditorLabel("Attributes", "CritterSprite")]
12+
[EditorDisplay(
13+
EmptyBehavior = EmptyBehavior.ShowNoneOnNullOrEmpty,
14+
StringBehavior = StringBehavior.Trim
15+
)]
16+
public string Sprite { get; set; }
17+
18+
[EditorLabel("Attributes", "CritterAnimation")]
19+
[EditorReference(typeof(AnimationDescriptor), nameof(AnimationDescriptor.Name))]
20+
public Guid AnimationId { get; set; }
21+
22+
//Movement types will mimic npc options?
23+
//Random
24+
//Turn
25+
//Still
26+
[EditorLabel("Attributes", "CritterMovement")]
27+
[EditorDictionary("Attributes", "CritterMovements")]
28+
public byte Movement { get; set; }
29+
30+
//Time in MS to traverse a tile once moving
31+
[EditorLabel("Attributes", "CritterSpeed")]
32+
[EditorTime]
33+
public int Speed { get; set; }
34+
35+
//Time in MS between movements?
36+
[EditorLabel("Attributes", "CritterFrequency")]
37+
[EditorTime]
38+
public int Frequency { get; set; }
39+
40+
//Lower, Middle, Upper
41+
[EditorLabel("Attributes", "CritterLayer")]
42+
[EditorDictionary("Attributes", "CritterLayers")]
43+
public byte Layer { get; set; }
44+
45+
[EditorLabel("Attributes", "CritterDirection")]
46+
[EditorDictionary(nameof(Direction), "CritterDirection")]
47+
public byte Direction { get; set; }
48+
49+
[EditorLabel("Attributes", "CritterIgnoreNpcAvoids")]
50+
[EditorBoolean(Style = BooleanStyle.YesNo)]
51+
public bool IgnoreNpcAvoids { get; set; }
52+
53+
[EditorLabel("Attributes", "CritterBlockPlayers")]
54+
[EditorBoolean(Style = BooleanStyle.YesNo)]
55+
public bool BlockPlayers { get; set; }
56+
57+
public override MapAttribute Clone()
58+
{
59+
var att = (MapCritterAttribute)base.Clone();
60+
att.Sprite = Sprite;
61+
att.AnimationId = AnimationId;
62+
att.Movement = Movement;
63+
att.Speed = Speed;
64+
att.Frequency = Frequency;
65+
att.Layer = Layer;
66+
att.IgnoreNpcAvoids = IgnoreNpcAvoids;
67+
68+
return att;
69+
}
70+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Intersect.Enums;
2+
3+
namespace Intersect.GameObjects.Maps;
4+
5+
public partial class MapGrappleStoneAttribute : MapAttribute
6+
{
7+
public override MapAttributeType Type => MapAttributeType.GrappleStone;
8+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Intersect.Enums;
2+
using Intersect.Framework.Core.GameObjects.Items;
3+
using Intersect.GameObjects.Annotations;
4+
5+
namespace Intersect.GameObjects.Maps;
6+
7+
public partial class MapItemAttribute : MapAttribute
8+
{
9+
public override MapAttributeType Type => MapAttributeType.Item;
10+
11+
[EditorLabel("Attributes", "Item")]
12+
[EditorReference(typeof(ItemDescriptor), nameof(ItemDescriptor.Name))]
13+
public Guid ItemId { get; set; }
14+
15+
[EditorLabel("Attributes", "Quantity")]
16+
[EditorDisplay]
17+
public int Quantity { get; set; }
18+
19+
public long RespawnTime { get; set; }
20+
21+
public override MapAttribute Clone()
22+
{
23+
var att = (MapItemAttribute) base.Clone();
24+
att.ItemId = ItemId;
25+
att.Quantity = Quantity;
26+
att.RespawnTime = RespawnTime;
27+
28+
return att;
29+
}
30+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Intersect.Enums;
2+
3+
namespace Intersect.GameObjects.Maps;
4+
5+
public partial class MapNpcAvoidAttribute : MapAttribute
6+
{
7+
public override MapAttributeType Type => MapAttributeType.NpcAvoid;
8+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Intersect.Enums;
2+
using Intersect.GameObjects.Annotations;
3+
4+
namespace Intersect.GameObjects.Maps;
5+
6+
public partial class MapResourceAttribute : MapAttribute
7+
{
8+
public override MapAttributeType Type => MapAttributeType.Resource;
9+
10+
[EditorLabel("Attributes", "Resource")]
11+
[EditorReference(typeof(ResourceBase), nameof(ResourceBase.Name))]
12+
public Guid ResourceId { get; set; }
13+
14+
[EditorLabel("Attributes", "ZDimension")]
15+
[EditorFormatted("Attributes", "FormatSpawnLevel")]
16+
public byte SpawnLevel { get; set; }
17+
18+
public override MapAttribute Clone()
19+
{
20+
var att = (MapResourceAttribute) base.Clone();
21+
att.ResourceId = ResourceId;
22+
att.SpawnLevel = SpawnLevel;
23+
24+
return att;
25+
}
26+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Intersect.Enums;
2+
using Intersect.GameObjects.Annotations;
3+
4+
namespace Intersect.GameObjects.Maps;
5+
6+
public partial class MapSlideAttribute : MapAttribute
7+
{
8+
public override MapAttributeType Type => MapAttributeType.Slide;
9+
10+
[EditorLabel("Attributes", "Direction")]
11+
[EditorDictionary(nameof(Direction), "WarpDirections")]
12+
public Direction Direction { get; set; }
13+
14+
public override MapAttribute Clone()
15+
{
16+
var att = (MapSlideAttribute) base.Clone();
17+
att.Direction = Direction;
18+
19+
return att;
20+
}
21+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Intersect.Enums;
2+
using Intersect.GameObjects.Annotations;
3+
4+
namespace Intersect.GameObjects.Maps;
5+
6+
public partial class MapSoundAttribute : MapAttribute
7+
{
8+
public override MapAttributeType Type => MapAttributeType.Sound;
9+
10+
[EditorLabel("Attributes", "Sound")]
11+
[EditorDisplay(
12+
EmptyBehavior = EmptyBehavior.ShowNoneOnNullOrEmpty,
13+
StringBehavior = StringBehavior.Trim
14+
)]
15+
public string File { get; set; }
16+
17+
[EditorLabel("Attributes", "SoundDistance")]
18+
[EditorFormatted("Attributes", "DistanceFormat")]
19+
public byte Distance { get; set; }
20+
21+
[EditorLabel("Attributes", "SoundInterval")]
22+
[EditorTime]
23+
public int LoopInterval { get; set; }
24+
25+
public override MapAttribute Clone()
26+
{
27+
var att = (MapSoundAttribute) base.Clone();
28+
att.File = File;
29+
att.Distance = Distance;
30+
att.LoopInterval = LoopInterval;
31+
32+
return att;
33+
}
34+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using Intersect.Enums;
2+
using Intersect.GameObjects.Annotations;
3+
using Intersect.Localization;
4+
5+
namespace Intersect.GameObjects.Maps;
6+
7+
public partial class MapWarpAttribute : MapAttribute
8+
{
9+
public override MapAttributeType Type => MapAttributeType.Warp;
10+
11+
[EditorLabel("Attributes", "Map")]
12+
[EditorReference(typeof(MapBase), nameof(MapBase.Name))]
13+
public Guid MapId { get; set; }
14+
15+
[EditorLabel("Attributes", "WarpX")]
16+
[EditorDisplay]
17+
public byte X { get; set; }
18+
19+
[EditorLabel("Attributes", "WarpY")]
20+
[EditorDisplay]
21+
public byte Y { get; set; }
22+
23+
[EditorLabel("Attributes", "WarpDirection")]
24+
[EditorDictionary(nameof(Direction), "WarpDirections")]
25+
public WarpDirection Direction { get; set; } = WarpDirection.Retain;
26+
27+
[EditorLabel("Warping", "ChangeInstance")]
28+
[EditorBoolean(Style = BooleanStyle.YesNo)]
29+
public bool ChangeInstance { get; set; } = false;
30+
31+
[EditorLabel("Warping", "InstanceType")]
32+
[EditorDictionary("MapInstance", "InstanceTypes")]
33+
public MapInstanceType InstanceType { get; set; } = MapInstanceType.Overworld;
34+
35+
[EditorLabel("Attributes", "WarpSound")]
36+
[EditorDisplay(
37+
EmptyBehavior = EmptyBehavior.ShowNoneOnNullOrEmpty,
38+
StringBehavior = StringBehavior.Trim
39+
)]
40+
public string WarpSound { get; set; }
41+
42+
public override MapAttribute Clone()
43+
{
44+
var att = (MapWarpAttribute) base.Clone();
45+
att.MapId = MapId;
46+
att.X = X;
47+
att.Y = Y;
48+
att.Direction = Direction;
49+
att.ChangeInstance = ChangeInstance;
50+
att.InstanceType = InstanceType;
51+
att.WarpSound = WarpSound;
52+
return att;
53+
}
54+
}

0 commit comments

Comments
 (0)