Le Weblog de ma saison de Rotisserie Baseball


Mes “moves” en VB.Net
avril 16, 2008, 11:09
Classé dans : Saison | Mots-clefs: ,

J’avais du temps l’autre matin et j’ai écris mes moves de mardi en langague informatique (VB.Net). Pourquoi? parce que c’est le fun!  Regardez l’adresse en haut: rotisseriefreak… Spaceman..

Private Sub MakeSpacemanMovesForApril_15th()

Dim LineUp As New MyLineUp
LineUp.Load()

Dim p, p2, p3 As Player

‘ Ty Winnington sur la DL…
p = LineUp.FindOneOfMyPlayers(“Ty Wigginton”)
p.Status = Player.eStatus.DL

‘ Trade Jones Pour Cantu
p = LineUp.FindOneOfMyPlayers(“Andruw Jones”)
LineUp.RemovePlayer(p)
p = LineUp.FindAPlayer(“Jorge Cantu”)
p.Status = Player.eStatus.Activ
p.Position = Player.ePosition.THIRDB
LineUp.AddPlayer(p)

‘ Is Dukes still on the DL?
p = LineUp.FindOneOfMyPlayers(“Elijha Dukes”)

If p.RealStatus = Player.eStatus.Activ Then

‘ no! put Pie on the bench spot left by Jones

p2 = LineUp.FindOneOfMyPlayers(“Felix Pie”)
p2.Status = Player.eStatus.Reserve
p.Status = Player.eStatus.Activ

ElseIf p.RealStatus = Player.eStatus.DL Then

‘ Still on the DL.. to bad..


‘ Let’s try to sign Paul Bako for 3 bucks and put
that 9$-part-time-catcher Paulino on the bench.

p2 = LineUp.FindAPlayer(“Paul Bako”)

If LineUp.SignFreeAgent(p2, 3) = True Then

‘ We have it! Paulino on the bench and Bako activ!
p2.Status = Player.eStatus.Activ
p2.Position = Player.ePosition.C
LineUp.AddPlayer(p2)

p3 = LineUp.FindOneOfMyPlayers(“Ronny Paulino”)
p3.Status = Player.eStatus.Reserve

End If

End If

‘ Drop Chris Perez
p3 = LineUp.FindOneOfMyPlayers(“Chris Perez”)
LineUp.RemovePlayer(p3)

‘ Try to sign Kevin Hart
p2 = LineUp.FindAPlayer(“Kevin Hart”)

If LineUp.SignFreeAgent(p2, 1) = True Then

‘ We have it!

p2.Status = Player.eStatus.Reserve
p2.Position = Player.ePosition.SP
LineUp.AddPlayer(p2)

End If

‘ Try to sign John Bowker who me be the best thing since sliced bread…
p2 = LineUp.FindAPlayer(“John Bowker”)

If LineUp.SignFreeAgent(p2, 3) = True Then

‘ We have it! Podsednick on the bench and Bowker activ!

p2.Status = Player.eStatus.Activ
p2.Position = Player.ePosition.UTIL
LineUp.AddPlayer(p2)

If LineUp.FindOneOfMyPlayers(“Chris Perez”) isNot Nothing Then
p3 = LineUp.FindOneOfMyPlayers(“Chris Perez”)
Else
p3 = LineUp.FindOneOfMyPlayers(“Scott Podsednick”)

End If
LineUp.RemovePlayer(p3)

End If


‘ Save everything
LineUp.Save()

End Sub


2 commentaires jusqu'à présent
Laisser un commentaire

VB? Wtf? Pas en C#?

Commentaire par desquebecoisaphoenix

Ben oui. On est resté collé en VB… :(

Commentaire par Pierre Masson




Laisser un commentaire
Retour à la ligne et paragraphes automatiques, adresse courriel toujours cachée, code HTML permis: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>