Mercurial > hg > Database > Christie-sharp
view datagear/command/CommandType.cs @ 5:5f2af64540be
fix
author | riono <e165729@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 25 Aug 2020 19:05:46 +0900 |
parents | a6f7466473f5 |
children | 5c334a1fbc5e |
line wrap: on
line source
using System.Collections.Generic; namespace Christie_net.datagear.command { public enum CommandType { PUT, TAKE, PEEK, REMOTETAKE, REMOTEPEEK, REPLY, CLOSE, FINISH }; public static class CommandTypeEtx { public static int id; // command ID public static Dictionary<int, CommandType> hash = new Dictionary<int, CommandType>(); private static int lastID = 0; // total command number private CommandTypeEtx() { this.id = id; } private static int IncrementLastID() { return ++lastID; } public static CommandType GetCommandTypeFromID(int id) { return hash[id]; } static { for(CommandType type: CommandType.va) } } }