comparison datagear/DataGears.cs @ 17:4a3115ba746d

fix CommandType enum
author riono <e165729@ie.u-ryukyu.ac.jp>
date Tue, 24 Nov 2020 03:11:50 +0900
parents 49521c7269bc
children c9d1a5a79254
comparison
equal deleted inserted replaced
16:7352793b5dbe 17:4a3115ba746d
1 using System; 1 using System;
2 using System.Collections.Concurrent; 2 using System.Collections.Concurrent;
3 using System.Collections.Generic; 3 using System.Collections.Generic;
4 using Christie_net.annotation;
4 using Christie_net.datagear.command; 5 using Christie_net.datagear.command;
5 using Christie_net.datagear.dg; 6 using Christie_net.datagear.dg;
6 7
7 namespace Christie_net.datagear { 8 namespace Christie_net.datagear {
8 public class DataGears { 9 public class DataGears {
69 /// </summary> 70 /// </summary>
70 /// <param name="cm"></param> 71 /// <param name="cm"></param>
71 /// <returns></returns> 72 /// <returns></returns>
72 public object GetData(Command cm) { 73 public object GetData(Command cm) {
73 lock (syncObject) { 74 lock (syncObject) {
74 switch (cm.type.commandType) { 75 CommandType type = cm.type;
75 case CommandType.TAKE: 76 if (type == CommandType.TAKE || type == CommandType.REMOTETAKE) {
76 case CommandType.REMOTETAKE: 77 return Take(cm.key);
77 return Take(cm.key); 78 } else if (type == CommandType.PEEK || type == CommandType.REMOTEPEEK){
78 case CommandType.PEEK: 79 return Peek(cm.key);
79 case CommandType.REMOTEPEEK:
80 return Peek(cm.key);
81 } 80 }
82
83 return null; 81 return null;
84 } 82 }
85 } 83 }
86 84
87 /// <summary> 85 /// <summary>