This repository has been archived by the owner on Jul 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContent.cs
113 lines (90 loc) · 2.69 KB
/
Content.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
using System.IO;
using System.Drawing;
namespace LEdit
{
public abstract class Content
{
public enum ContentType
{
Unknown,
File,
Monster,
MonsterSprite,
}
public static string FormatID(int ID)
{
return ID.ToString("D4");
}
public static ContentType GetContentType(string Text)
{
switch (Text.ToLower())
{
case "file":
return ContentType.File;
case "monster":
return ContentType.Monster;
case "monstersprite":
return ContentType.MonsterSprite;
default:
return ContentType.Unknown;
}
}
public static string GetContentText(ContentType Type)
{
switch (Type)
{
case ContentType.File:
return "file";
case ContentType.Monster:
return "monster";
case ContentType.MonsterSprite:
return "monstersprite";
default:
return string.Empty;
}
}
public static string GetContentFolderName(ContentType Type)
{
switch (Type)
{
case ContentType.Monster:
return "monsters";
case ContentType.MonsterSprite:
return "monstersprites";
default:
return string.Empty;
}
}
public static string GetFileExtension(ContentType Type)
{
switch (Type)
{
case ContentType.Monster:
return ".l2monster";
case ContentType.MonsterSprite:
return ".l2monstersprite";
default:
return ".l2";
}
}
public static Content Retrieve(ContentType Type, int ID)
{
switch (Type)
{
case ContentType.Monster:
return L2Monster.Array[ID];
case ContentType.MonsterSprite:
return L2MonsterSprite.Array[ID];
default:
return null;
}
}
public int ID = -1;
public abstract string GetName();
public abstract Bitmap GetIcon();
public abstract void FromStream(BinaryReader br);
public abstract void ToStream(BinaryWriter bw);
public abstract void Load(FileInfo File);
public abstract void Save(FileInfo File);
}
}