Skip to content

Commit 3081d34

Browse files
committed
Initial work on DictionaryList
1 parent e92962f commit 3081d34

File tree

2 files changed

+39
-8
lines changed

2 files changed

+39
-8
lines changed

DictionaryList/Class1.cs

Lines changed: 0 additions & 8 deletions
This file was deleted.

DictionaryList/DictionaryList.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
namespace DictionaryList
5+
{
6+
/// <summary>
7+
/// Represents a strongly-typed list of objects that has a dictionary-like structure.
8+
/// Elements can be accessed by an index which is ordered but not guaranteed to be continuous.
9+
/// </summary>
10+
public class DictionaryList<TValue>
11+
{
12+
internal struct DataBox<TData>
13+
{
14+
internal TData Value;
15+
16+
internal DataBox(TData value)
17+
{
18+
Value = value;
19+
}
20+
}
21+
22+
internal List<DataBox<TValue>> _list = new List<DataBox<TValue>>();
23+
24+
internal int _actualCount;
25+
26+
/// <summary>
27+
/// Initializes a new instance of the `DictionaryList&lt;TValue&gt;` class that is empty and has the default capacity.
28+
/// </summary>
29+
public DictionaryList()
30+
{
31+
32+
}
33+
34+
/// <summary>
35+
/// Returns the number of active elements in this DictionaryList.
36+
/// </summary>
37+
public int Count => _actualCount;
38+
}
39+
}

0 commit comments

Comments
 (0)