Commit 95993ffa authored by Orbmancer's avatar Orbmancer
Browse files

began to integrate Contents

parent a6e12c1a
......@@ -3,7 +3,8 @@
error_reporting(E_ALL);
ini_set('display_errors', 1);
require 'Data.class.php';
require_once 'Data.class.php';
require_once 'model/Contents.class.php';
$name = $_POST['name'];
$data = $_POST['data'];
......@@ -19,5 +20,21 @@ var_dump($td);
Data::saveXML($data, $name, $x, $y, $td);
echo '<br/>';
var_dump(Data::loadXML($td));
$levels = Data::loadXML($td);
$contents[] = array();
var_dump($levels);
foreach($levels as $level){
$myContent = new Contents();
$myContent->importXML($level['content']);
$contents[] = $myContent;
}
echo '<br/>';
echo '<br/>';
echo '<br/>';
echo '<br/>';
var_dump($levels);
//Merge $levels
\ No newline at end of file
......@@ -32,8 +32,8 @@ class Contents
$prev_y = 1;
for($i=0; $i<count($contents); ++$i){
$tab_x = (int) floor($i / $this->$tabWidth);
$tab_y = (int) floor($i / ($this->$tabwidth * $this->$tabHeight * $this->mapwidth));
$tab_x = (int) floor($i / self::$tabwidth);
$tab_y = (int) floor($i / (self::$tabwidth * self::$tabheight * $this->mapwidth));
$line[] = $contents[$i];
if($prev_y != $tab_y){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment