Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Last active October 10, 2019 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gavilanch/c67356712ff412477c720961bc13c051 to your computer and use it in GitHub Desktop.
Save gavilanch/c67356712ff412477c720961bc13c051 to your computer and use it in GitHub Desktop.
@code{
List<Jugada> jugadas = new List<Jugada>()
{
new Jugada{Imagen = "piedra.jpg", OptionPPT = OpcionPPT.Piedra,
VenceA = OpcionPPT.Tijera, PierdeContra = OpcionPPT.Papel},
new Jugada{Imagen = "tijeras.jpg", OptionPPT = OpcionPPT.Tijera,
VenceA = OpcionPPT.Papel, PierdeContra = OpcionPPT.Piedra},
new Jugada{Imagen = "papel.jpg", OptionPPT = OpcionPPT.Papel,
VenceA = OpcionPPT.Piedra, PierdeContra = OpcionPPT.Tijera}
};
Jugada jugadaOponente;
protected override void OnInitialized()
{
jugadaOponente = jugadas[0];
timer = new Timer();
timer.Interval = 100; // Cada 100 ms
timer.Elapsed += TimerOnElapsed; // ejecutar este método
timer.Start();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment