-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e90e56
commit f81ff9a
Showing
4 changed files
with
181 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,151 @@ | ||
using System.Collections; | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
namespace oop1 | ||
{ | ||
[Serializable] | ||
public partial class MyColletion<T> : IList<T>, IList, ICollection<T>, ICollection, IEnumerable<T>, IEnumerable | ||
{ | ||
public T this[int index] | ||
{ | ||
get | ||
{ | ||
|
||
int level1 = index % 16; | ||
index /= 16; | ||
int level2 = index % 16; | ||
index /= 16; | ||
int level3 = index % 16; | ||
index /= 16; | ||
int level4 = index % 16; | ||
index /= 16; | ||
int level5 = index % 16; | ||
index /= 16; | ||
int level6 = index % 16; | ||
index /= 16; | ||
int level7 = index % 16; | ||
index /= 16; | ||
int level8 = index % 16; | ||
index /= 16; | ||
return internalStorage[level8][level7][level6][level5][level4][level3][level2][level1]; | ||
} | ||
set | ||
{ | ||
|
||
int level1 = index % 16; | ||
index /= 16; | ||
int level2 = index % 16; | ||
index /= 16; | ||
int level3 = index % 16; | ||
index /= 16; | ||
int level4 = index % 16; | ||
index /= 16; | ||
int level5 = index % 16; | ||
index /= 16; | ||
int level6 = index % 16; | ||
index /= 16; | ||
int level7 = index % 16; | ||
index /= 16; | ||
int level8 = index % 16; | ||
index /= 16; | ||
internalStorage[level8][level7][level6][level5][level4][level3][level2][level1] = value; | ||
} | ||
} | ||
private ContinerOf16Items<ContinerOf16Items<ContinerOf16Items<ContinerOf16Items<ContinerOf16Items<ContinerOf16Items<ContinerOf16Items<ContinerOf16Items<T>>>>>>>> internalStorage; | ||
|
||
|
||
|
||
public int Count => throw new NotImplementedException(); | ||
|
||
public bool IsReadOnly => throw new NotImplementedException(); | ||
|
||
bool IList.IsFixedSize => throw new NotImplementedException(); | ||
|
||
bool ICollection.IsSynchronized => throw new NotImplementedException(); | ||
|
||
object ICollection.SyncRoot => throw new NotImplementedException(); | ||
|
||
object IList.this[int index] { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } | ||
|
||
public MyColletion() { } | ||
|
||
public int IndexOf(T item) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Insert(int index, T item) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void RemoveAt(int index) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Add(T item) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void Clear() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public bool Contains(T item) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void CopyTo(T[] array, int arrayIndex) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public bool Remove(T item) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public IEnumerator<T> GetEnumerator() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
int IList.Add(object value) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
bool IList.Contains(object value) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
int IList.IndexOf(object value) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
void IList.Insert(int index, object value) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
void IList.Remove(object value) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
void ICollection.CopyTo(Array array, int index) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
|
||
<IsPackable>false</IsPackable> | ||
<IsTestProject>true</IsTestProject> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" /> | ||
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4" /> | ||
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" /> | ||
<PackageReference Include="coverlet.collector" Version="6.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\oop1\oop1.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |