using System;
public class Test
{
TrainStyle trainStyle = TrainStyle.Null;
void Add(TrainStyle ts)
{
trainStyle |= ts;
}
void Remove(TrainStyle ts)
{
trainStyle &= (~ts);
}
bool Contain(TrainStyle ts)
{
return (trainStyle & ts)!= 0;
}
} [Flags] public enum TrainStyle { Null = 0, G = 1, D = 2 << 1, T = 2 << 2, K = 2 << 3, Z = 2 << 4, C = 2 << 5, Other = 2 << 6 }