diff datagear/command/Command.cs @ 16:7352793b5dbe

add some Commands
author riono <e165729@ie.u-ryukyu.ac.jp>
date Sun, 22 Nov 2020 01:52:22 +0900
parents 49521c7269bc
children 4a3115ba746d
line wrap: on
line diff
--- a/datagear/command/Command.cs	Sat Nov 21 02:21:04 2020 +0900
+++ b/datagear/command/Command.cs	Sun Nov 22 01:52:22 2020 +0900
@@ -6,6 +6,7 @@
 
 namespace Christie_net.datagear.command {
 public abstract class Command {
+    private CommandType _type;
     public CommandTypeEtx type;
     public string key;
     public string toDgmName; // for take
@@ -17,7 +18,8 @@
     public Connection connection = null; // for reply
 
     public Command(CommandBuilder cb) {
-        this.type = cb.type;
+        this._type =  cb.type.commandType;
+        this.type = new CommandTypeEtx(_type);
         this.key = cb.key;
         this.toDgmName = cb.toDgmName;
         this.fromDgmName = cb.fromDgmname;
@@ -34,7 +36,7 @@
     public abstract void Execute();
 
     // for remote
-    public abstract byte[] Convert();
+    public abstract MemoryStream Convert();
 
     public RemoteMessage CreateRemoteMessage() {
         return new RemoteMessage(type.id, fromDgmName, key, clazz.Name);