-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtensionHandler.cs
More file actions
30 lines (27 loc) · 838 Bytes
/
ExtensionHandler.cs
File metadata and controls
30 lines (27 loc) · 838 Bytes
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace L2Script.Library
{
public class ExtensionHandler
{
private Extension[] loadedExtensions = new Extension[0];
public void Add(Extension ext)
{
Extension[] newExt = new Extension[loadedExtensions.Length + 1];
loadedExtensions.CopyTo(newExt, 0);
newExt[loadedExtensions.Length] = ext;
loadedExtensions = newExt;
}
public object Get(string shortname)
{
for (int i = 0; i < loadedExtensions.Length; i++)
{
if (loadedExtensions[i].ShortName == shortname)
return loadedExtensions[i].Resource;
}
return null;
}
}
}