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
genie_logiciel_2015
the_dungeon_project
Commits
bf243270
Commit
bf243270
authored
Jan 05, 2016
by
Arnaud Guerquin
Browse files
try catch
parent
0c9c0668
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ingame_programming/IGPEntity.java
View file @
bf243270
...
...
@@ -7,9 +7,6 @@ import core.gamestate.GameContent;
import
core.relayer.Relayer
;
import
core.zone.Direction
;
import
core.gamestate.Character
;
import
core.gamestate.Entity
;
import
core.gamestate.GameState
;
import
core.gamestate.EntityNotFoundExeption
;
import
java.util.*
;
/** The AbstractEntity generated for the IA implied by the FollowerBehaviour in BehaviourHolder
...
...
@@ -27,7 +24,12 @@ public class IGPEntity extends AbstractEntity {
@Override
public
void
act
()
{
FollowerBehaviour
fb
=
behold
.
GetFollowerBehaviour
();
List
<
Character
>
chlist
=
gameState
.
getAllCharacters
();
List
<
Character
>
chlist
=
null
;
try
{
gameState
.
getAllCharacters
();
}
catch
(
InterruptedException
e
){
return
;
}
/* TODO : ne garder que les personnages visibles ? */
Character
victim
=
fb
.
FindTarget
(
chlist
);
String
action
=
fb
.
getAction
();
...
...
@@ -76,8 +78,12 @@ public class IGPEntity extends AbstractEntity {
/*TODO : Soigner victim */
break
;
default
:
Entity
owner
=
null
;
try
{
Entity
owner
=
gameState
.
getEntity
(
relayer
.
getCharacter
().
getOwner
());
owner
=
gameState
.
getEntity
(
relayer
.
getCharacter
().
getOwner
());
}
catch
(
Exception
e
){
return
;
}
int
dX3
=
owner
.
getX
();
int
dY3
=
owner
.
getY
();
int
sX3
=
relayer
.
getCharacter
().
getX
();
...
...
@@ -85,8 +91,5 @@ public class IGPEntity extends AbstractEntity {
Direction
dir3
=
AI
.
alpha_star
(
map
,
sX3
,
sY3
,
dX3
,
dY3
,
map
.
getWidth
(),
map
.
getHeight
());
this
.
relayer
.
move
(
dir3
);
}
catch
(
EntityNotFoundExeption
e
)
{
}
}
}
}
Write
Preview
Supports
Markdown
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