Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
El Legado De Pintia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
diegval
El Legado De Pintia
Commits
c66b9526
Commit
c66b9526
authored
4 months ago
by
victor
Browse files
Options
Downloads
Patches
Plain Diff
Feature:
damshin
parent
beb62094
No related branches found
Branches containing commit
No related tags found
2 merge requests
!65
Feature:
,
!59
Feature:
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/com/example/ellegadodepintia/exploradoresDePintia/model/LayoutUtils.kt
+23
-13
23 additions, 13 deletions
...llegadodepintia/exploradoresDePintia/model/LayoutUtils.kt
with
23 additions
and
13 deletions
app/src/main/java/com/example/ellegadodepintia/exploradoresDePintia/model/LayoutUtils.kt
+
23
−
13
View file @
c66b9526
...
...
@@ -12,7 +12,7 @@ import com.example.ellegadodepintia.R
import
com.example.ellegadodepintia.exploradoresDePintia.ModalDetallesFragment
import
com.example.ellegadodepintia.exploradoresDePintia.model.GameState.context
import
com.example.ellegadodepintia.exploradoresDePintia.model.objeto.Objeto
import
android.animation.ObjectAnimator
object
LayoutUtils
{
...
...
@@ -40,6 +40,8 @@ object LayoutUtils {
actualizarJugador
(
barraVida
,
ataqueText
,
investigacionText
,
vidaText
,
energiaText
,
barraEnergia
)
}
private
fun
actualizarJugador
(
barraVida
:
ProgressBar
,
ataqueText
:
TextView
,
...
...
@@ -48,25 +50,33 @@ object LayoutUtils {
energiaText
:
TextView
,
barraEnergia
:
ProgressBar
)
{
barraVida
.
max
=
GameState
.
jugador
.
vidaMax
barraVida
.
progress
=
GameState
.
jugador
.
atributos
[
Atributo
.
Vida
]
!!
barraEnergia
.
max
=
GameState
.
jugador
.
energiaMax
barraEnergia
.
progress
=
GameState
.
jugador
.
atributos
[
Atributo
.
Energia
]
!!
val
vidaMax
=
GameState
.
jugador
.
vidaMax
val
vidaActual
=
GameState
.
jugador
.
atributos
[
Atributo
.
Vida
]
!!
if
(
barraVida
.
progress
!=
vidaActual
)
{
ObjectAnimator
.
ofInt
(
barraVida
,
"progress"
,
barraVida
.
progress
,
vidaActual
).
apply
{
duration
=
1000
start
()
}
}
barraVida
.
max
=
vidaMax
ataqueText
.
text
=
"${GameState.jugador.atributos[Atributo.Ataque]}"
investigacionText
.
text
=
"${GameState.jugador.atributos[Atributo.Investigacion]}"
val
vidaInfo
=
"${GameState.jugador.atributos[Atributo.Vida]}/${GameState.jugador.vidaMax}"
val
vidaInfo
=
"$vidaActual/$vidaMax"
vidaText
.
text
=
vidaInfo
val
energiaInfo
=
"${GameState.jugador.atributos[Atributo.Energia]}/${GameState.jugador.energiaMax}"
val
energiaMax
=
GameState
.
jugador
.
energiaMax
val
energiaActual
=
GameState
.
jugador
.
atributos
[
Atributo
.
Energia
]
!!
if
(
barraEnergia
.
progress
!=
energiaActual
)
{
ObjectAnimator
.
ofInt
(
barraEnergia
,
"progress"
,
barraEnergia
.
progress
,
energiaActual
).
apply
{
duration
=
500
start
()
}
}
barraEnergia
.
max
=
energiaMax
val
energiaInfo
=
"$energiaActual/$energiaMax"
energiaText
.
text
=
energiaInfo
}
fun
actualizarEstadisticasEvento
()
{
val
barraEvento
=
context
!!
.
findViewById
<
ProgressBar
>(
R
.
id
.
barraEvento
)
barraEvento
.
max
=
GameState
.
eventoActual
.
resistenciaMax
barraEvento
.
progress
=
GameState
.
eventoActual
.
resistenciaActual
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment