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
ab892f2f
Commit
ab892f2f
authored
Dec 19, 2018
by
李进峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
所在地点 null repair
parent
572086f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
29 deletions
+39
-29
GameEnv.java
src/GameEnvironment/GameEnv.java
+39
-29
No files found.
src/GameEnvironment/GameEnv.java
View file @
ab892f2f
...
...
@@ -61,12 +61,17 @@ public class GameEnv implements Serializable{
Place
place
=
new
Place
();
place
.
setIntro
((
String
)
one
.
get
(
"intro"
));
place
.
setName
((
String
)
one
.
get
(
"name"
));
place
.
setGoFlag
((
Integer
)
one
.
get
(
"goFlag"
));
if
(((
Integer
)
one
.
get
(
"goFlag"
)).
equals
(
new
Integer
(
2
)))
{
this
.
placeLinkDirectGo
.
put
(
place
.
getName
(),
place
);
}
else
if
(((
Integer
)
one
.
get
(
"goFlag"
)).
equals
(
new
Integer
(
3
)))
{
this
.
placeNoLinkDirectGo
.
put
(
place
.
getName
(),
place
);
if
(
one
.
get
(
"goFlag"
)!=
null
)
{
place
.
setGoFlag
((
Integer
)
one
.
get
(
"goFlag"
));
if
(((
Integer
)
one
.
get
(
"goFlag"
)).
equals
(
new
Integer
(
2
)))
{
this
.
placeLinkDirectGo
.
put
(
place
.
getName
(),
place
);
}
else
if
(((
Integer
)
one
.
get
(
"goFlag"
)).
equals
(
new
Integer
(
3
)))
{
this
.
placeNoLinkDirectGo
.
put
(
place
.
getName
(),
place
);
}
}
else
{
place
.
setGoFlag
(
new
Integer
(
1
));
}
List
<
String
>
nickname
=
(
List
<
String
>)
one
.
get
(
"nickname"
);
place
.
setGoodsInstances
(
new
ArrayList
<
GoodsInstance
>());
place
.
setNpcInstances
(
new
ArrayList
<
NpcInstance
>());
...
...
@@ -180,15 +185,17 @@ public class GameEnv implements Serializable{
npcInstance
.
setAttrs
(
npcInstanceAttrs
);
Place
place
=
null
;
if
(
instanceAttrMap
.
get
(
"所在地点"
)!=
null
)
{
Map
<
String
,
Object
>
placeMap
=
(
Map
<
String
,
Object
>)
map
.
get
((
String
)
instanceAttrMap
.
get
(
"所在地点"
));
if
(
placeMap
!=
null
)
{
place
=
placeIndex
.
get
(
placeMap
.
get
(
"name"
));
List
<
NpcInstance
>
npcInstances
=
place
.
getNpcInstances
();
if
(
npcInstances
==
null
)
{
npcInstances
=
new
ArrayList
<
NpcInstance
>();
if
(!
instanceAttrMap
.
get
(
"所在地点"
).
equals
(
""
))
{
Map
<
String
,
Object
>
placeMap
=
(
Map
<
String
,
Object
>)
map
.
get
((
String
)
instanceAttrMap
.
get
(
"所在地点"
));
if
(
placeMap
!=
null
)
{
place
=
placeIndex
.
get
(
placeMap
.
get
(
"name"
));
List
<
NpcInstance
>
npcInstances
=
place
.
getNpcInstances
();
if
(
npcInstances
==
null
)
{
npcInstances
=
new
ArrayList
<
NpcInstance
>();
}
npcInstances
.
add
(
npcInstance
);
place
.
setNpcInstances
(
npcInstances
);
}
npcInstances
.
add
(
npcInstance
);
place
.
setNpcInstances
(
npcInstances
);
}
}
...
...
@@ -265,26 +272,29 @@ public class GameEnv implements Serializable{
}
goodsInstance
.
setAttrs
(
goodsInstanceAttrs
);
if
(
instanceAttrMap
.
get
(
"所在地点"
)!=
null
)
{
Map
<
String
,
Object
>
placeMap
=
(
Map
<
String
,
Object
>)
map
.
get
((
String
)
instanceAttrMap
.
get
(
"所在地点"
));
Place
place
=
placeIndex
.
get
(
placeMap
.
get
(
"name"
));
goodsInstance
.
setPlace
(
place
);
List
<
GoodsInstance
>
placeGoodsInstances
=
place
.
getGoodsInstances
();
if
(
placeGoodsInstances
==
null
)
{
placeGoodsInstances
=
new
ArrayList
<
GoodsInstance
>();
if
(!
instanceAttrMap
.
get
(
"所在地点"
).
equals
(
""
))
{
Map
<
String
,
Object
>
placeMap
=
(
Map
<
String
,
Object
>)
map
.
get
((
String
)
instanceAttrMap
.
get
(
"所在地点"
));
Place
place
=
placeIndex
.
get
(
placeMap
.
get
(
"name"
));
goodsInstance
.
setPlace
(
place
);
List
<
GoodsInstance
>
placeGoodsInstances
=
place
.
getGoodsInstances
();
if
(
placeGoodsInstances
==
null
)
{
placeGoodsInstances
=
new
ArrayList
<
GoodsInstance
>();
}
placeGoodsInstances
.
add
(
goodsInstance
);
place
.
setGoodsInstances
(
placeGoodsInstances
);
}
placeGoodsInstances
.
add
(
goodsInstance
);
place
.
setGoodsInstances
(
placeGoodsInstances
);
}
if
(
instanceAttrMap
.
get
(
"所属角色"
)!=
null
){
System
.
out
.
println
(
npcNames
.
get
((
String
)
instanceAttrMap
.
get
(
"所属角色"
)));
NpcInstance
npc
=
this
.
npcInstanceIndex
.
get
(
npcNames
.
get
((
String
)
instanceAttrMap
.
get
(
"所属角色"
)));
goodsInstance
.
setNpc
(
npc
);
List
<
GoodsInstance
>
npcGoodsInstances
=
npc
.
getGoodsInstances
();
if
(
npcGoodsInstances
==
null
)
{
npcGoodsInstances
=
new
ArrayList
<
GoodsInstance
>();
if
(!
instanceAttrMap
.
get
(
"所属角色"
).
equals
(
""
))
{
NpcInstance
npc
=
this
.
npcInstanceIndex
.
get
(
npcNames
.
get
((
String
)
instanceAttrMap
.
get
(
"所属角色"
)));
goodsInstance
.
setNpc
(
npc
);
List
<
GoodsInstance
>
npcGoodsInstances
=
npc
.
getGoodsInstances
();
if
(
npcGoodsInstances
==
null
)
{
npcGoodsInstances
=
new
ArrayList
<
GoodsInstance
>();
}
npcGoodsInstances
.
add
(
goodsInstance
);
npc
.
setGoodsInstances
(
npcGoodsInstances
);
}
npcGoodsInstances
.
add
(
goodsInstance
);
npc
.
setGoodsInstances
(
npcGoodsInstances
);
}
// if(instanceAttrMap.get("placeId")!=null) {
// Map<String, Object> placeMap = (Map<String, Object>)map.get(String.valueOf(instanceAttrMap.get("placeId")));
...
...
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