OSDN Git Service

#17688 - Extract costume data.
authormumin <mumincacao@users.sourceforge.jp>
Sun, 2 Aug 2009 13:06:11 +0000 (22:06 +0900)
committermumin <mumincacao@users.sourceforge.jp>
Sun, 2 Aug 2009 13:06:11 +0000 (22:06 +0900)
documents/changes.en.txt
documents/changes.ja.txt
trust_path/modules/sd3rd/class/Enum.class.php
trust_path/modules/sd3rd/class/handler/Costume.class.php [new file with mode: 0644]
trust_path/modules/sd3rd/class/updater/dispose/Backup.class.php
trust_path/modules/sd3rd/class/updater/execute/parser/char/Costume_Data.class.php [new file with mode: 0644]
trust_path/modules/sd3rd/class/updater/prepare/RefreshTable.class.php
trust_path/modules/sd3rd/class/updater/prepare/SetupContext.class.php
trust_path/modules/sd3rd/sql/mysql.sql

index f5bf2ad..8ee2b5b 100644 (file)
@@ -1,3 +1,4 @@
+#17688 - Extract costume data.
 #18085 - Fixed passed by reference variable.
 #17991 - Remove br tag on normalize process.
 #17990 - Change master data process.
index 34262e6..7e54ece 100644 (file)
@@ -1,3 +1,4 @@
+#17688 - \82±\82·\82Å\81`\82½\82Ì\92\8a\8fo\8f\88\97\9d\82ð\92Ç\89Á
 #18085 - \8eQ\8fÆ\82Å\8eó\82¯\8eæ\82Á\82Ä\82é\82Ì\82ª\8ec\82Á\82Ä\82¢\82½\82Ì\82Å\8fC\90³
 #17991 - \90³\8bK\89»\8e\9e\82É br \82½\82®\82ð\82È\82©\82Á\82½\82±\82Æ\82É
 #17990 - \82Ü\82·\82½\91\80\8dì\82Ü\82í\82è\82Ì\8f\88\97\9d\82ð\90®\97\9d
index 9856bec..fd70298 100644 (file)
@@ -17,6 +17,7 @@ interface Sd3rd_HANDLER
 {
     const ABILITY = 'Ability';
     const CHAR = 'Char';
+    const COSTUME = 'Costume';
     const UPDATE = 'Update';
 }
 
diff --git a/trust_path/modules/sd3rd/class/handler/Costume.class.php b/trust_path/modules/sd3rd/class/handler/Costume.class.php
new file mode 100644 (file)
index 0000000..a4681e9
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/**
+ * @file
+ * @package sd3rd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD3RD_TRUST_PATH . '/class/AbstractMasterHandler.class.php';
+
+/**
+ * Sd3rd_CostumeObject
+**/
+class Sd3rd_CostumeObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('costume_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('costume_name', XOBJ_DTYPE_STRING, '', false, 50);
+        $this->initVar('grow_life', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_soul', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_pow', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_str', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_dex', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_speed', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_mag', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_reg', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_con', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_hp', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_at', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_df', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_mat', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_mdf', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_hit', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_con', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_act', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_avoid', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('move_cost', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('regist_time', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd3rd_CostumeHandler
+**/
+class Sd3rd_CostumeHandler extends Sd3rd_AbstractMasterHandler
+{
+    public /*** string ***/ $mTable = '{dirname}_costume';
+    public /*** string ***/ $mPrimary = 'costume_id';
+    public /*** string ***/ $mClass = 'Sd3rd_CostumeObject';
+    protected /*** string ***/ $_mIdColumn = 'costume_id';
+    protected /*** string ***/ $_mValueColumn = 'costume_name';
+}
+
+?>
index dd5d623..5a80d79 100644 (file)
@@ -210,6 +210,7 @@ class Sd3rd_BackupDispose extends Sd3rd_AbstractFilter
         $this->_mTableList = array(
             Sd3rd_HANDLER::ABILITY,
             Sd3rd_HANDLER::CHAR,
+            Sd3rd_HANDLER::COSTUME,
             Sd3rd_HANDLER::UPDATE
         );
     }
diff --git a/trust_path/modules/sd3rd/class/updater/execute/parser/char/Costume_Data.class.php b/trust_path/modules/sd3rd/class/updater/execute/parser/char/Costume_Data.class.php
new file mode 100644 (file)
index 0000000..dcfda1c
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * @file
+ * @package sd3rd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * Extract process for Chardata at costume.
+**/
+class Sd3rd_Costume_DataChar extends Sd3rd_AbstractParser
+{
+    protected /*** Sd3rd_CostumeHandler ***/ $_mHandler = null;
+    
+    /**
+     * Constructor of this process.
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->_mHandler = Sd3rd_UpdateUtils::getHandler(Sd3rd_HANDLER::COSTUME);
+    }
+    
+    /**
+     * Latest main process.
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function executeLatest()
+    {
+        $data = Sd3rd_UpdateUtils::parseByRegex($this->_mSource,"/\('(?P<name>[^']+)',(?P<clv>\d+),'(?P<exp>\d+)\/(?P<next>\d+)',(?P<cp>\d+),(?P<grow_life>\-?\d+),(?P<grow_soul>\-?\d+),(?P<grow_pow>\-?\d+),(?P<grow_str>\-?\d+),(?P<grow_dex>\-?\d+),(?P<grow_speed>\-?\d+),(?P<grow_mag>\-?\d+),(?P<grow_reg>\-?\d+),(?P<grow_con>\-?\d+),(?P<modify_hp>\-?\d+),(?P<modify_at>\-?\d+),(?P<modify_df>\-?\d+),(?P<modify_mat>\-?\d+),(?P<modify_mdf>\-?\d+),(?P<modify_hit>\-?\d+),(?P<modify_con>\-?\d+),(?P<modify_act>\-?\d+),(?P<modify_avoid>\-?\d+),(?P<move_cost>\d+)\)/");
+        $id = $this->_mHandler->getId($data['name'],array('grow_life' => $data['grow_life'],'grow_soul' => $data['grow_soul'],'grow_pow' => $data['grow_pow'],'grow_str' => $data['grow_str'],'grow_dex' => $data['grow_dex'],'grow_speed' => $data['grow_speed'],'grow_mag' => $data['grow_mag'],'grow_reg' => $data['grow_reg'],'grow_con' => $data['grow_con'],'modify_hp' => $data['modify_hp'],'modify_at' => $data['modify_at'],'modify_df' => $data['modify_df'],'modify_mat' => $data['modify_mat'],'modify_mdf' => $data['modify_mdf'],'modify_hit' => $data['modify_hit'],'modify_con' => $data['modify_con'],'modify_act' => $data['modify_act'],'modify_avoid' => $data['modify_avoid'],'move_cost' => $data['move_cost'],'register_time' => $this->_mUpdateTime),true);
+    }
+}
+
+?>
index 91da25c..b9f6712 100644 (file)
@@ -75,7 +75,7 @@ class Sd3rd_RefreshTablePrepare extends Sd3rd_AbstractFilter
     **/
     public function executeLatest()
     {
-        $this->_mRegisterTableList = array(Sd3rd_HANDLER::ABILITY);
+        $this->_mRegisterTableList = array(Sd3rd_HANDLER::ABILITY,Sd3rd_HANDLER::COSTUME);
         $this->_mUpdateTableList = array(Sd3rd_HANDLER::UPDATE);
         $this->_mTruncateTableList = array(Sd3rd_HANDLER::CHAR);
     }
@@ -92,6 +92,7 @@ class Sd3rd_RefreshTablePrepare extends Sd3rd_AbstractFilter
         $this->_mTruncateTableList = array(
             Sd3rd_HANDLER::ABILITY,
             Sd3rd_HANDLER::CHAR,
+            Sd3rd_HANDLER::COSTUME,
             Sd3rd_HANDLER::UPDATE
         );
     }
index 7a47213..9c79b1f 100644 (file)
@@ -36,7 +36,10 @@ class Sd3rd_SetupContextPrepare extends Sd3rd_AbstractFilter
     **/
     public function executeLatest()
     {
-        Sd3rd_UpdateUtils::getHandler(Sd3rd_HANDLER::ABILITY)->setupMaster();
+        foreach(array(Sd3rd_HANDLER::ABILITY,Sd3rd_HANDLER::COSTUME) as $table)
+        {
+            Sd3rd_UpdateUtils::getHandler($table)->setupMaster();
+        }
     }
 }
 
index 773c0b7..68b9f28 100644 (file)
@@ -16,6 +16,32 @@ CREATE TABLE `{dirname}_{prefix}_char` (
   PRIMARY KEY  (`eno`)
 ) ENGINE=MyISAM;
 
+CREATE TABLE `{dirname}_{prefix}_costume` (
+  `costume_id` tinyint(3) unsigned NOT NULL auto_increment,
+  `costume_name` varchar(50) NOT NULL,
+  `grow_life` tinyint(4) NOT NULL,
+  `grow_soul` tinyint(4) NOT NULL,
+  `grow_pow` tinyint(4) NOT NULL,
+  `grow_str` tinyint(4) NOT NULL,
+  `grow_dex` tinyint(4) NOT NULL,
+  `grow_speed` tinyint(4) NOT NULL,
+  `grow_mag` tinyint(4) NOT NULL,
+  `grow_reg` tinyint(4) NOT NULL,
+  `grow_con` tinyint(4) NOT NULL,
+  `modify_hp` tinyint(4) NOT NULL,
+  `modify_at` tinyint(4) NOT NULL,
+  `modify_df` tinyint(4) NOT NULL,
+  `modify_mat` tinyint(4) NOT NULL,
+  `modify_mdf` tinyint(4) NOT NULL,
+  `modify_hit` tinyint(4) NOT NULL,
+  `modify_con` tinyint(4) NOT NULL,
+  `modify_act` tinyint(4) NOT NULL,
+  `modify_avoid` tinyint(4) NOT NULL,
+  `move_cost` tinyint(3) unsigned NOT NULL,
+  `register_time` int(10) unsigned NOT NULL,
+  PRIMARY KEY  (`costume_id`)
+) ENGINE=MyISAM;
+
 CREATE TABLE `{dirname}_{prefix}_update` (
   `update_time` int(10) unsigned NOT NULL,
   PRIMARY KEY  (`update_time`)