34 lines
986 B
C#
34 lines
986 B
C#
using System;
|
|
|
|
namespace Global.Shared.API
|
|
{
|
|
public static class GridFlag
|
|
{
|
|
public const long None = 0;
|
|
private static int _taken;
|
|
public static long StaticGrid = CreateFlag();
|
|
public static long DynamicGrid = CreateFlag();
|
|
public static long SmallGrid = CreateFlag();
|
|
public static long LargeGrid = CreateFlag();
|
|
|
|
public static long CreateFlag()
|
|
{
|
|
if (_taken == 31) throw new Exception("Too many grid flags created. Max is 30.");
|
|
return 1 << _taken++;
|
|
}
|
|
}
|
|
|
|
public static class PlayerFlag
|
|
{
|
|
public const long None = 0;
|
|
private static int _taken;
|
|
public static long Character = CreateFlag();
|
|
public static long Controlled = CreateFlag();
|
|
|
|
public static long CreateFlag()
|
|
{
|
|
if (_taken == 31) throw new Exception("Too many player flags created. Max is 30.");
|
|
return 1 << _taken++;
|
|
}
|
|
}
|
|
} |