mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 01:44:35 +08:00
remove BitMask
This commit is contained in:
parent
fea46221e0
commit
1890943d5a
@ -1,38 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
public class BitMask
|
||||
{
|
||||
private int[] data;
|
||||
|
||||
public int Length { get; private set; }
|
||||
|
||||
public BitMask(int length)
|
||||
{
|
||||
Length = length;
|
||||
data = new int[(length + 31) / 32];
|
||||
}
|
||||
|
||||
public void Resize(int newLength)
|
||||
{
|
||||
Length = newLength;
|
||||
Array.Resize(ref data, (newLength + 31) / 32);
|
||||
}
|
||||
|
||||
public void Set1(int index)
|
||||
{
|
||||
data[index / 32] |= 1 << (index % 32);
|
||||
}
|
||||
|
||||
public void Set0(int index)
|
||||
{
|
||||
data[index / 32] &= ~(1 << (index % 32));
|
||||
}
|
||||
|
||||
public bool Get(int index)
|
||||
{
|
||||
return (data[index / 32] & (1 << (index % 32))) != 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88bc1ea51d98c0843a48314fbe00ad9e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user