Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Normand Erwan
VVVVVV_level_merger
Commits
c3b43ba3
Commit
c3b43ba3
authored
Jun 01, 2015
by
Orbmancer
Browse files
VICTORY ALGO IS FUNCTIONNAL !!!!! beer beer beer :)
parent
30d8be25
Changes
3
Hide whitespace changes
Inline
Side-by-side
index.php
View file @
c3b43ba3
...
...
@@ -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>
...
...
merge.php
View file @
c3b43ba3
...
...
@@ -6,7 +6,7 @@ ini_set('display_errors', 1);
require_once
'model/Data.class.php'
;
require_once
'model/Tabs.class.php'
;
$td
=
$_
GE
T
[
'td'
];
$td
=
$_
POS
T
[
'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
model/Tabs.class.php
View file @
c3b43ba3
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment