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
781ce1b4
Commit
781ce1b4
authored
Apr 02, 2019
by
hxw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
游戏生成时删除内存中的存档
parent
1131c600
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
GameEnv.java
...java/com/qiwu/chatbotbackend/GameEnvironment/GameEnv.java
+6
-5
No files found.
src/main/java/com/qiwu/chatbotbackend/GameEnvironment/GameEnv.java
View file @
781ce1b4
...
...
@@ -75,7 +75,7 @@ public class GameEnv implements Serializable{
Map
<
String
,
Object
>
placeTmpMap
=
(
Map
<
String
,
Object
>)
gameProjectMap
.
get
(
"place"
);
if
(
placeTmpMap
!=
null
&&
!
placeTmpMap
.
isEmpty
())
{
// 地图基本数据定义
List
<
String
>
placeNames
=
new
ArrayList
<
String
>(
placeTmpMap
.
keySet
());
List
<
String
>
placeNames
=
new
ArrayList
<>(
placeTmpMap
.
keySet
());
for
(
int
i
=
0
;
i
<
placeNames
.
size
();
i
++)
{
String
placeName
=
placeNames
.
get
(
i
);
Map
<
String
,
Object
>
placeMap
=
(
Map
<
String
,
Object
>)
placeTmpMap
.
get
(
placeName
);
...
...
@@ -111,6 +111,7 @@ public class GameEnv implements Serializable{
// 别名
List
<
String
>
nicknames
=
(
List
<
String
>)
placeMap
.
get
(
"nicknames"
);
for
(
int
i
=
0
;
i
<
nicknames
.
size
();
i
++)
{
System
.
out
.
println
(
nicknames
.
get
(
i
));
Nickname
nickname
=
this
.
getNicknameUtil
(
nicknames
.
get
(
i
));
Map
<
String
,
Place
>
nicknamePlaceMap
=
nickname
.
getPlaceMap
();
nicknamePlaceMap
.
put
(
place
.
getName
(),
place
);
...
...
@@ -594,7 +595,7 @@ public class GameEnv implements Serializable{
}
// 查询指定物品的简介
public
String
queryGoodsIntroByGoodsName
(
String
name
){
GoodsInstance
goodsInstance
=
this
.
findGoodsInstanceByNameOrNickn
ame
(
name
);
GoodsInstance
goodsInstance
=
this
.
queryGoodsByGoodsN
ame
(
name
);
if
(
goodsInstance
!=
null
)
{
return
goodsInstance
.
getAttrs
().
get
(
"intro"
);
}
else
{
...
...
@@ -667,7 +668,7 @@ public class GameEnv implements Serializable{
}
// 查询指定NPC简介
public
String
queryNpcIntroByNpcName
(
String
name
){
NpcInstance
npcInstance
=
this
.
findNpcInstanceByNameOrNickn
ame
(
name
);
NpcInstance
npcInstance
=
queryNpcByNpcN
ame
(
name
);
return
npcInstance
.
getAttrs
().
get
(
"intro"
);
}
// 查询指定npc的属性值
...
...
@@ -693,7 +694,7 @@ public class GameEnv implements Serializable{
// 查询指定npc的所有属性
public
List
<
String
>
queryNpcAttrsByNpcName
(
String
name
){
List
<
String
>
attrNames
=
new
ArrayList
<
String
>();
NpcInstance
npcInstance
=
this
.
findNpcInstanceByNameOrNickn
ame
(
name
);
NpcInstance
npcInstance
=
queryNpcByNpcN
ame
(
name
);
if
(
npcInstance
!=
null
)
{
attrNames
.
addAll
(
npcInstance
.
getAttrs
().
keySet
());
return
attrNames
;
...
...
@@ -703,7 +704,7 @@ public class GameEnv implements Serializable{
}
// 查询角色的地点
public
String
queryNpcSiteByNpcName
(
String
npcName
)
{
return
this
.
findNpcInstanceByNameOrNickn
ame
(
npcName
).
getPlace
().
getName
();
return
this
.
queryNpcByNpcN
ame
(
npcName
).
getPlace
().
getName
();
}
// 增加
public
boolean
insert
(
String
name
){
...
...
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