Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new_taobao
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
new_taobao
Commits
eab321e5
Commit
eab321e5
authored
Sep 30, 2020
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified: project/src/canvas/game/src/xiaoxiaole/XxlScene.ts
parent
8cb21f11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
132 additions
and
20 deletions
+132
-20
XxlScene.ts
project/src/canvas/game/src/xiaoxiaole/XxlScene.ts
+132
-20
No files found.
project/src/canvas/game/src/xiaoxiaole/XxlScene.ts
View file @
eab321e5
...
@@ -19,9 +19,17 @@ declare interface point {
...
@@ -19,9 +19,17 @@ declare interface point {
y
:
number
;
y
:
number
;
}
}
/**
* 男左女右
*/
class
noder
{
class
noder
{
mother
:
noder
=
null
mother
:
noder
=
null
father
:
noder
=
null
father
:
noder
=
null
bother
:
noder
=
null
sister
:
noder
=
null
son
:
noder
=
null
daughter
:
noder
=
null
index
:
number
index
:
number
item
:
CircleItem
=
null
item
:
CircleItem
=
null
p
:
point
=
null
p
:
point
=
null
...
@@ -460,60 +468,139 @@ export class XxlScene extends Scene {
...
@@ -460,60 +468,139 @@ export class XxlScene extends Scene {
const
nowrightindex
=
this
.
hexIndices
[
i
][
t1
+
offset
]
const
nowrightindex
=
this
.
hexIndices
[
i
][
t1
+
offset
]
const
rightbotherindex
=
this
.
hexIndices
[
i
][
t1
+
offset
-
1
]
const
rightsisterindex
=
this
.
hexIndices
[
i
][
t1
+
offset
+
1
]
let
fatherright
=
this
.
ItemMap
.
get
(
fatherrightindex
)
let
fatherright
=
this
.
ItemMap
.
get
(
fatherrightindex
)
let
motherright
=
this
.
ItemMap
.
get
(
motherrightindex
)
let
motherright
=
this
.
ItemMap
.
get
(
motherrightindex
)
let
nowright
=
this
.
ItemMap
.
get
(
nowrightindex
)
let
nowright
=
this
.
ItemMap
.
get
(
nowrightindex
)
let
rightbother
=
this
.
ItemMap
.
get
(
rightbotherindex
)
let
rightsister
=
this
.
ItemMap
.
get
(
rightsisterindex
)
nowright
.
bother
=
rightbother
nowright
.
sister
=
rightsister
nowright
.
father
=
fatherright
nowright
.
father
=
fatherright
if
(
fatherright
)
{
fatherright
.
daughter
=
nowright
}
nowright
.
mother
=
motherright
nowright
.
mother
=
motherright
if
(
motherright
)
{
motherright
.
son
=
nowright
}
//左移
//左移
let
fatherleftindex
=
this
.
hexIndices
[
i
-
1
][
t2
-
1
-
offset
]
const
fatherleftindex
=
this
.
hexIndices
[
i
-
1
][
t2
-
1
-
offset
]
let
motherleftindex
=
this
.
hexIndices
[
i
-
1
][
t2
-
offset
]
const
motherleftindex
=
this
.
hexIndices
[
i
-
1
][
t2
-
offset
]
let
nowleftindex
=
this
.
hexIndices
[
i
][
t1
-
offset
]
const
nowleftindex
=
this
.
hexIndices
[
i
][
t1
-
offset
]
const
leftbotherindex
=
this
.
hexIndices
[
i
][
t1
-
offset
-
1
]
const
leftsisterindex
=
this
.
hexIndices
[
i
][
t1
-
offset
+
1
]
let
nowleft
=
this
.
ItemMap
.
get
(
nowleftindex
)
let
nowleft
=
this
.
ItemMap
.
get
(
nowleftindex
)
let
fatherleft
=
this
.
ItemMap
.
get
(
fatherleftindex
)
let
fatherleft
=
this
.
ItemMap
.
get
(
fatherleftindex
)
let
motherleft
=
this
.
ItemMap
.
get
(
motherleftindex
)
let
motherleft
=
this
.
ItemMap
.
get
(
motherleftindex
)
let
leftbother
=
this
.
ItemMap
.
get
(
leftbotherindex
)
let
leftsister
=
this
.
ItemMap
.
get
(
leftsisterindex
)
nowleft
.
bother
=
leftbother
nowleft
.
sister
=
leftsister
nowleft
.
father
=
fatherleft
nowleft
.
father
=
fatherleft
if
(
fatherleft
)
{
fatherleft
.
daughter
=
nowleft
}
nowleft
.
mother
=
motherleft
nowleft
.
mother
=
motherleft
if
(
motherleft
)
{
motherleft
.
son
=
nowleft
}
}
else
{
}
else
{
//中间项
//中间项
let
fatherindex
=
this
.
hexIndices
[
i
-
1
][
t2
-
1
]
const
fatherindex
=
this
.
hexIndices
[
i
-
1
][
t2
-
1
]
let
motherindex
=
this
.
hexIndices
[
i
-
1
][
t2
]
const
motherindex
=
this
.
hexIndices
[
i
-
1
][
t2
]
let
nowindex
=
this
.
hexIndices
[
i
][
t1
]
const
nowindex
=
this
.
hexIndices
[
i
][
t1
]
const
botherindex
=
this
.
hexIndices
[
i
][
t1
-
1
]
const
sisterindex
=
this
.
hexIndices
[
i
][
t1
+
1
]
let
now
=
this
.
ItemMap
.
get
(
nowindex
)
let
now
=
this
.
ItemMap
.
get
(
nowindex
)
now
.
father
=
this
.
ItemMap
.
get
(
fatherindex
)
let
father
=
this
.
ItemMap
.
get
(
fatherindex
)
now
.
mother
=
this
.
ItemMap
.
get
(
motherindex
)
let
mother
=
this
.
ItemMap
.
get
(
motherindex
)
let
bother
=
this
.
ItemMap
.
get
(
botherindex
)
let
sister
=
this
.
ItemMap
.
get
(
sisterindex
)
now
.
bother
=
bother
now
.
sister
=
sister
now
.
father
=
father
if
(
father
)
{
father
.
daughter
=
now
}
now
.
mother
=
mother
if
(
mother
)
{
mother
.
son
=
now
}
}
}
}
}
}
else
{
}
else
{
for
(
let
offset
=
0
;
offset
<
t1
;
offset
++
)
{
for
(
let
offset
=
0
;
offset
<
t1
;
offset
++
)
{
//右移
//右移
let
fatherrightindex
=
this
.
hexIndices
[
i
-
1
][
t2
+
offset
]
const
fatherrightindex
=
this
.
hexIndices
[
i
-
1
][
t2
+
offset
]
let
motherrightindex
=
this
.
hexIndices
[
i
-
1
][
t2
+
1
+
offset
]
const
motherrightindex
=
this
.
hexIndices
[
i
-
1
][
t2
+
1
+
offset
]
let
nowrightindex
=
this
.
hexIndices
[
i
][
t1
+
offset
]
const
nowrightindex
=
this
.
hexIndices
[
i
][
t1
+
offset
]
const
rightbotherindex
=
this
.
hexIndices
[
i
][
t1
+
offset
-
1
]
const
rightsisterindex
=
this
.
hexIndices
[
i
][
t1
+
offset
+
1
]
let
nowright
=
this
.
ItemMap
.
get
(
nowrightindex
)
let
nowright
=
this
.
ItemMap
.
get
(
nowrightindex
)
nowright
.
father
=
this
.
ItemMap
.
get
(
fatherrightindex
)
let
rightfather
=
this
.
ItemMap
.
get
(
fatherrightindex
)
nowright
.
mother
=
this
.
ItemMap
.
get
(
motherrightindex
)
let
rightmother
=
this
.
ItemMap
.
get
(
motherrightindex
)
let
rightbother
=
this
.
ItemMap
.
get
(
rightbotherindex
)
let
rightsister
=
this
.
ItemMap
.
get
(
rightsisterindex
)
nowright
.
bother
=
rightbother
nowright
.
sister
=
rightsister
nowright
.
father
=
rightfather
if
(
rightfather
)
{
rightfather
.
daughter
=
nowright
}
nowright
.
mother
=
rightmother
if
(
rightmother
)
{
rightmother
.
son
=
nowright
}
//左移
//左移
let
fatherleftindex
=
this
.
hexIndices
[
i
-
1
][
t2
-
1
-
offset
]
const
fatherleftindex
=
this
.
hexIndices
[
i
-
1
][
t2
-
1
-
offset
]
let
motherleftindex
=
this
.
hexIndices
[
i
-
1
][
t2
-
offset
]
const
motherleftindex
=
this
.
hexIndices
[
i
-
1
][
t2
-
offset
]
let
nowleftindex
=
this
.
hexIndices
[
i
][
t1
-
offset
-
1
]
const
nowleftindex
=
this
.
hexIndices
[
i
][
t1
-
offset
-
1
]
const
leftbotherindex
=
this
.
hexIndices
[
i
][
t1
-
offset
-
2
]
const
leftsisterindex
=
this
.
hexIndices
[
i
][
t1
-
offset
]
let
nowleft
=
this
.
ItemMap
.
get
(
nowleftindex
)
let
nowleft
=
this
.
ItemMap
.
get
(
nowleftindex
)
nowleft
.
father
=
this
.
ItemMap
.
get
(
fatherleftindex
)
let
leftfather
=
this
.
ItemMap
.
get
(
fatherleftindex
)
nowleft
.
mother
=
this
.
ItemMap
.
get
(
motherleftindex
)
let
leftmother
=
this
.
ItemMap
.
get
(
motherleftindex
)
let
leftbother
=
this
.
ItemMap
.
get
(
leftbotherindex
)
let
leftsister
=
this
.
ItemMap
.
get
(
leftsisterindex
)
nowleft
.
bother
=
leftbother
nowleft
.
sister
=
leftsister
nowleft
.
father
=
leftfather
if
(
leftfather
)
{
leftfather
.
daughter
=
nowleft
}
nowleft
.
mother
=
leftmother
if
(
leftmother
)
{
leftmother
.
son
=
nowleft
}
}
}
}
}
}
}
}
}
// console.log(this.ItemMap)
console
.
log
(
this
.
ItemMap
)
this
.
isImpasse
()
if
(
this
.
userInfo
.
isNewUser
)
{
if
(
this
.
userInfo
.
isNewUser
)
{
let
i
=
0
let
i
=
0
...
@@ -870,7 +957,32 @@ export class XxlScene extends Scene {
...
@@ -870,7 +957,32 @@ export class XxlScene extends Scene {
}
}
//是否是僵局
isImpasse
():
boolean
{
let
isImpasse
=
true
for
(
let
i
in
this
.
ItemMap
)
{
let
noder
=
this
.
ItemMap
[
i
]
if
(
noder
.
father
&&
noder
.
item
.
type
==
noder
.
father
.
item
.
type
)
{
isImpasse
=
false
}
if
(
noder
.
mother
&&
noder
.
item
.
type
==
noder
.
mother
.
item
.
type
)
{
isImpasse
=
true
}
if
(
noder
.
bother
&&
noder
.
item
.
type
==
noder
.
bother
.
item
.
type
)
{
isImpasse
=
true
}
if
(
noder
.
sister
&&
noder
.
item
.
type
==
noder
.
sister
.
item
.
type
)
{
isImpasse
=
true
}
if
(
noder
.
son
&&
noder
.
item
.
type
==
noder
.
son
.
item
.
type
)
{
isImpasse
=
true
}
if
(
noder
.
daughter
&&
noder
.
item
.
type
==
noder
.
daughter
.
item
.
type
)
{
isImpasse
=
true
}
}
return
isImpasse
}
...
...
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