열차 목업의 내부 확인용 프로젝트
smchoi
2024-07-24 ec231f4110c782d44ea2820a1eaaa7a5711c6f16
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
using System.Collections.Generic;
using System.Diagnostics;
 
public class DeleteList
{
    public List<string> objNames;
 
    public int Count { get { return objNames == null ? 0 : objNames.Count; } }
 
    public DeleteList() { }
 
    public bool Add(string name)
    {
        if (objNames == null)
            objNames = new List<string>();
 
        if (!objNames.Contains(name))
        {
            objNames.Add(name);
            return true;
        }
        return false;
    }
 
    public void Clear() {
        if (objNames != null) {
            objNames.Clear();
        }
    }
 
    public bool Contains(string name)
    {
        if (objNames != null && objNames.Contains(name))
        {
            return true;
        }
        return false;
    }
 
    public bool Remove(string name) {
        if (objNames != null && objNames.Contains(name)) {
            return objNames.Remove(name);
        }
        return false;
    }
 
    public void RemoveAt(int index) {
        if (objNames != null && index >= 0 && index < objNames.Count) {
            objNames.RemoveAt(index);
        }
    }
}