Commit c3b43ba3 authored by Orbmancer's avatar Orbmancer
Browse files

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

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