Show / Hide Table of Contents

# Class SparseMap<T>

##### Inheritance

object
SparseMap<T>

###### Namespace: LiteEntitySystem.Collections

###### Assembly: LiteEntitySystem.dll

##### Syntax

    public class SparseMap<T>

##### Type Parameters

Name | Description
--- | ---
T |

### Constructors

#### SparseMap()

##### Declaration

    public SparseMap()

#### SparseMap(int)

##### Declaration

    public SparseMap(int capacity)

##### Parameters

Type | Name | Description
--- | --- | ---
int | capacity |

### Properties

#### Count

##### Declaration

    public int Count { get; }

##### Property Value

Type | Description
--- | ---
int |

### Methods

#### Clear()

##### Declaration

    public void Clear()

#### Contains(int)

##### Declaration

    public bool Contains(int id)

##### Parameters

Type | Name | Description
--- | --- | ---
int | id |

##### Returns

Type | Description
--- | ---
bool |

#### CopyTo(SparseMap<T>)

##### Declaration

    public void CopyTo(SparseMap<T> target)

##### Parameters

Type | Name | Description
--- | --- | ---
SparseMap<T> | target |

#### FindIndex(int)

##### Declaration

    public int FindIndex(int id)

##### Parameters

Type | Name | Description
--- | --- | ---
int | id |

##### Returns

Type | Description
--- | ---
int |

#### GetById(int)

##### Declaration

    public ref T GetById(int id)

##### Parameters

Type | Name | Description
--- | --- | ---
int | id |

##### Returns

Type | Description
--- | ---
T |

#### GetByIndex(int)

##### Declaration

    public ref T GetByIndex(int index)

##### Parameters

Type | Name | Description
--- | --- | ---
int | index |

##### Returns

Type | Description
--- | ---
T |

#### GetSparseEntryByIndex(int)

##### Declaration

    public ref readonly SparseMap<T>.SparseEntry GetSparseEntryByIndex(int index)

##### Parameters

Type | Name | Description
--- | --- | ---
int | index |

##### Returns

Type | Description
--- | ---
SparseMap<T>.SparseEntry |

#### Remove(int)

##### Declaration

    public bool Remove(int id)

##### Parameters

Type | Name | Description
--- | --- | ---
int | id |

##### Returns

Type | Description
--- | ---
bool |

#### Remove(int, out T)

##### Declaration

    public bool Remove(int id, out T removedElement)

##### Parameters

Type | Name | Description
--- | --- | ---
int | id |
T | removedElement |

##### Returns

Type | Description
--- | ---
bool |

#### Set(int, T)

##### Declaration

    public void Set(int id, T value)

##### Parameters

Type | Name | Description
--- | --- | ---
int | id |
T | value |

#### TryGetSparseEntry(int, out SparseEntry)

##### Declaration

    public bool TryGetSparseEntry(int id, out SparseMap<T>.SparseEntry result)

##### Parameters

Type | Name | Description
--- | --- | ---
int | id |
SparseMap<T>.SparseEntry | result |

##### Returns

Type | Description
--- | ---
bool |

#### TryGetValue(int, out T)

##### Declaration

    public bool TryGetValue(int id, out T result)

##### Parameters

Type | Name | Description
--- | --- | ---
int | id |
T | result |

##### Returns

Type | Description
--- | ---
bool |