OSDN Git Service

Subframeの実装と非抽象クラス化
authorkimikage <kimikage_ceo@hotmail.com>
Thu, 24 Feb 2011 12:19:06 +0000 (21:19 +0900)
committerkimikage <kimikage_ceo@hotmail.com>
Thu, 24 Feb 2011 12:19:06 +0000 (21:19 +0900)
Yubeshi/Gps/Subframe.cs

index 2a63b2c..8508e24 100755 (executable)
@@ -11,16 +11,43 @@ using System.Text;
 \r
 namespace Yubeshi.Gps\r
 {\r
-    public abstract class Subframe\r
+    public class Subframe\r
     {\r
-        #region fields\r
-        protected Word[] words;\r
-        #endregion\r
+        #region constructors\r
+\r
+        public Subframe(Subframe frame)\r
+        {\r
+            Words = frame.Words;\r
+        }\r
 \r
-        #region constructor\r
         public Subframe(Word[] words)\r
         {\r
-            this.words = words;\r
+            Words = words;\r
+        }\r
+\r
+        public Subframe(byte[] raw)\r
+        {\r
+            Words = new Word[raw.Length / 4];\r
+            for (int i = 0; i < Words.Length; ++i)\r
+            {\r
+                Words[i] = BitConverter.ToUInt32(raw, i * 4);\r
+            }\r
+        }\r
+        \r
+\r
+        protected Subframe()\r
+        {\r
+            Words = null;\r
+        }\r
+\r
+        #endregion\r
+\r
+        #region properties\r
+\r
+        public Word[] Words\r
+        {\r
+            get;\r
+            protected set;\r
         }\r
 \r
         #endregion\r