Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
qwgame
Project
Overview
Details
Activity
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
赵国君
qwgame
Commits
31f6d74a
Commit
31f6d74a
authored
Dec 15, 2018
by
李进峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update place
parent
57b66100
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
GameEnv.java
src/GameEnvironment/GameEnv.java
+34
-2
No files found.
src/GameEnvironment/GameEnv.java
View file @
31f6d74a
...
@@ -271,6 +271,7 @@ public class GameEnv implements Serializable{
...
@@ -271,6 +271,7 @@ public class GameEnv implements Serializable{
place
.
setGoodsInstances
(
placeGoodsInstances
);
place
.
setGoodsInstances
(
placeGoodsInstances
);
}
}
if
(
instanceAttrMap
.
get
(
"所属角色"
)!=
null
){
if
(
instanceAttrMap
.
get
(
"所属角色"
)!=
null
){
System
.
out
.
println
(
npcNames
.
get
((
String
)
instanceAttrMap
.
get
(
"所属角色"
)));
NpcInstance
npc
=
this
.
npcInstanceIndex
.
get
(
npcNames
.
get
((
String
)
instanceAttrMap
.
get
(
"所属角色"
)));
NpcInstance
npc
=
this
.
npcInstanceIndex
.
get
(
npcNames
.
get
((
String
)
instanceAttrMap
.
get
(
"所属角色"
)));
goodsInstance
.
setNpc
(
npc
);
goodsInstance
.
setNpc
(
npc
);
List
<
GoodsInstance
>
npcGoodsInstances
=
npc
.
getGoodsInstances
();
List
<
GoodsInstance
>
npcGoodsInstances
=
npc
.
getGoodsInstances
();
...
@@ -731,13 +732,33 @@ public class GameEnv implements Serializable{
...
@@ -731,13 +732,33 @@ public class GameEnv implements Serializable{
}
}
if
(
goodsInstanceBoolean
)
{
if
(
goodsInstanceBoolean
)
{
List
<
Attr
>
attrs
=
goodsInstance
.
getAttrs
();
List
<
Attr
>
attrs
=
goodsInstance
.
getAttrs
();
if
(
names
[
3
].
equals
(
"所在地点"
))
{
Place
placeOrigin
=
goodsInstance
.
getPlace
();
List
<
GoodsInstance
>
goodsInstances
=
placeOrigin
.
getGoodsInstances
();
goodsInstances
.
remove
(
goodsInstance
);
Place
place
=
this
.
placeIndex
.
get
(
value
);
goodsInstance
.
setPlace
(
place
);
goodsInstances
=
place
.
getGoodsInstances
();
goodsInstances
.
add
(
goodsInstance
);
return
true
;
}
else
if
(
names
[
3
].
equals
(
"所属角色"
))
{
NpcInstance
npcInstance
=
goodsInstance
.
getNpc
();
List
<
GoodsInstance
>
goodsInstances
=
npcInstance
.
getGoodsInstances
();
goodsInstances
.
remove
(
goodsInstance
);
npcInstance
=
this
.
npcInstanceIndex
.
get
(
value
);
goodsInstance
.
setNpc
(
npcInstance
);
goodsInstances
=
npcInstance
.
getGoodsInstances
();
goodsInstances
.
add
(
goodsInstance
);
return
true
;
}
else
{
for
(
int
j
=
0
;
j
<
attrs
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
attrs
.
size
();
j
++)
{
if
(
names
[
3
].
equals
(
attrs
.
get
(
j
).
getName
()))
{
if
(
names
[
3
].
equals
(
attrs
.
get
(
j
).
getName
()))
{
attrs
.
get
(
j
).
setValue
(
value
);
attrs
.
get
(
j
).
setValue
(
value
);
return
true
;
return
true
;
}
}
}
}
return
true
;
}
}
else
{
}
else
{
return
false
;
return
false
;
}
}
...
@@ -762,11 +783,22 @@ public class GameEnv implements Serializable{
...
@@ -762,11 +783,22 @@ public class GameEnv implements Serializable{
}
else
{
}
else
{
continue
;
continue
;
}
}
}
return
true
;
}
else
if
(
names
[
3
].
equals
(
"所在地点"
))
{
Place
placeOrigin
=
npcInstance
.
getPlace
();
List
<
NpcInstance
>
npcInstances
=
placeOrigin
.
getNpcInstances
();
npcInstances
.
remove
(
npcInstance
);
Place
place
=
this
.
placeIndex
.
get
(
value
);
npcInstance
.
setPlace
(
place
);
npcInstances
=
place
.
getNpcInstances
();
npcInstances
.
add
(
npcInstance
);
return
true
;
}
else
{
attrs
.
get
(
j
).
setValue
(
value
);
attrs
.
get
(
j
).
setValue
(
value
);
return
true
;
return
true
;
}
}
}
}
}
return
true
;
return
true
;
}
else
{
}
else
{
return
false
;
return
false
;
...
...
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