Commit c3b43ba3 authored by Orbmancer's avatar Orbmancer
Browse files

VICTORY ALGO IS FUNCTIONNAL !!!!! beer beer beer :)

parent 30d8be25
...@@ -111,8 +111,8 @@ ...@@ -111,8 +111,8 @@
<label for="td" class="col-lg-2 control-label">Which level group ?</label> <label for="td" class="col-lg-2 control-label">Which level group ?</label>
<div class="col-lg-10"> <div class="col-lg-10">
<select class="form-control" name="td" id="td"> <select class="form-control" name="td" id="td">
<option>1</option> <option>TD 1</option>
<option>2</option> <option>TD 2</option>
</select> </select>
</div> </div>
</div> </div>
......
...@@ -6,7 +6,7 @@ ini_set('display_errors', 1); ...@@ -6,7 +6,7 @@ ini_set('display_errors', 1);
require_once 'model/Data.class.php'; require_once 'model/Data.class.php';
require_once 'model/Tabs.class.php'; require_once 'model/Tabs.class.php';
$td = $_GET['td']; $td = $_POST['td'];
$levels = Data::loadXML($td); $levels = Data::loadXML($td);
...@@ -14,21 +14,15 @@ $levels = Data::loadXML($td); ...@@ -14,21 +14,15 @@ $levels = Data::loadXML($td);
$finalTabs = new Tabs(); $finalTabs = new Tabs();
$finalTabs->fillBlank(); $finalTabs->fillBlank();
$final = new Tabs(); var_dump($levels);
$final->fillBlank();
foreach($levels as $level){ foreach($levels as $level){
$myContent = new Tabs(); $myContent = new Tabs();
$myContent->importXML($level['data']); $myContent->importXML($level['data']);
echo '<br/>'.$myContent->toString(); $finalTabs->setTab($myContent->getTab(), $level['x'], $level['y']);
//$final->setTab($myContent->getTab(), $level['x'], $level['y']);
unset($myContent);
break;
} }
//echo '<br/>'.$final->toString();
// Create the XML file // Create the XML file
/*
$finalFile = simplexml_load_file('data/level_layout.vvvvvv'); $finalFile = simplexml_load_file('data/level_layout.vvvvvv');
$finalFile->Data->contents = $finalTabs->toString(); $finalFile->Data->contents = $finalTabs->toString();
...@@ -39,4 +33,3 @@ header('Expires: 0'); ...@@ -39,4 +33,3 @@ header('Expires: 0');
header('Cache-Control: must-revalidate'); header('Cache-Control: must-revalidate');
header('Pragma: public'); header('Pragma: public');
print($finalFile->asXML()); print($finalFile->asXML());
*/
\ No newline at end of file
...@@ -33,7 +33,6 @@ class Tabs ...@@ -33,7 +33,6 @@ class Tabs
for($i=0; $i<count($tabs)-1; ++$i){ for($i=0; $i<count($tabs)-1; ++$i){
$tab_x = $this->getTabX($i); $tab_x = $this->getTabX($i);
$tab_y = $this->getTabY($i); $tab_y = $this->getTabY($i);
echo 'TAB INDEX: '.$i.' : '.$tab_x.'|'.$tab_y.'<br/>';
$line[] = (int) $tabs[$i]; $line[] = (int) $tabs[$i];
...@@ -104,12 +103,10 @@ class Tabs ...@@ -104,12 +103,10 @@ class Tabs
public function toString(){ public function toString(){
$txt = ''; $txt = '';
for($i=1; $i<=5; ++$i){ for($j=1; $j<=5; ++$j){
for($j=1; $j<=5; ++$j) { for($l=0; $l<=29; ++$l){
//echo 'TOSTRING, i='.$i.' j='.$j.' LINE COUNT='.count($this->tabs[$i][$j]).'<br/>'; for($i=1; $i<=5; ++$i){
foreach($this->tabs[$i][$j] as $l => $line) { foreach($this->tabs[$i][$j][$l] as $b => $block){
//echo 'BLOCK COUNT = '.count($line).'<br/>';
foreach($line as $b => $block){
$txt.= $block.','; $txt.= $block.',';
} }
} }
...@@ -125,7 +122,6 @@ class Tabs ...@@ -125,7 +122,6 @@ class Tabs
public function getTab(){ public function getTab(){
$where = $this->whereIsMyLevelLocated(); $where = $this->whereIsMyLevelLocated();
echo 'WHERE:'.$where['x'].'|'.$where['y'].'<br/>';
return $this->tabs[$where['x']][$where['y']]; return $this->tabs[$where['x']][$where['y']];
} }
} }
\ No newline at end of file
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