Mercurial > repos > RelicTools > RelicTools
comparison Collections/ChunkyCollection.cs @ 0:82db9430c2e4 default tip
Initial commit under GPLv3
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 06 Oct 2018 19:49:25 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:82db9430c2e4 |
---|---|
1 // This file is a part of the Relic Tools and is copyright 2006-2018 IBBoard. | |
2 // | |
3 // The file and the library/program it is in are licensed under the GNU GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. | |
4 using System; | |
5 using System.Collections; | |
6 | |
7 namespace IBBoard.Relic.RelicTools.Collections | |
8 { | |
9 /// <summary> | |
10 /// Summary description for ChunkyCollection. | |
11 /// </summary> | |
12 public class ChunkyCollection | |
13 { | |
14 private ArrayList arr; | |
15 private ChunkyFolder parent; | |
16 | |
17 public ChunkyCollection() | |
18 { | |
19 arr = new ArrayList(); | |
20 } | |
21 | |
22 public ChunkyCollection(ChunkyFolder parentFolder):this() | |
23 { | |
24 parent = parentFolder; | |
25 } | |
26 | |
27 public void Add(ChunkyChunk chunk) | |
28 { | |
29 if (chunk!=null) | |
30 { | |
31 arr.Add(chunk); | |
32 chunk.Parent = parent; | |
33 } | |
34 } | |
35 | |
36 public ChunkyChunk this[int key] | |
37 { | |
38 get{return (ChunkyChunk)arr[key];} | |
39 set{ if (value!=null){arr[key] = value;}} | |
40 } | |
41 | |
42 public void Remove(ChunkyChunk chunk) | |
43 { | |
44 arr.Remove(chunk); | |
45 } | |
46 | |
47 public int Count | |
48 { | |
49 get{return arr.Count;} | |
50 } | |
51 | |
52 public IEnumerator GetEnumerator() | |
53 { | |
54 return arr.GetEnumerator(); | |
55 } | |
56 } | |
57 } |