Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members

InfectVIH.cs

Go to the documentation of this file.
00001 /*
00002 SimImmuno version 1.0
00003 Copyright (C) 2005 sebeuh.ajsinfo.net
00004 
00005 SimImmuno est libre, vous pouvez le redistribuer et/ou le modifier
00006 selon les termes de la Licence Publique Générale GNU publiée par la
00007 Free Software Foundation (version 2).
00008 
00009 SimImmuno est distribué car potentiellement utile, mais SANS AUCUNE GARANTIE,
00010 ni explicite ni implicite, y compris les garanties de commercialisation
00011 ou d'adaptation dans un but spécifique. Reportez-vous à la
00012 Licence Publique Générale GNU pour plus de détails.
00013 
00014 Texte de la license officielle (anglais) :
00015 http://simimmuno.ajsinfo.net/text.aspx?code=no&txt_file=GPL.txt
00016 Traduction francaise (non-officielle) :
00017 http://simimmuno.ajsinfo.net/text.aspx?code=no&txt_file=GPL-fr.txt
00018 */
00019 using System;
00020 
00021 namespace SimImmuno
00022 {
00023         [Serializable]
00024         public class InfectVIH : Cellule
00025         {
00026                 bool mutation;
00027 
00028                 public InfectVIH(int x, int y) : base(x,y)
00029                 {
00030                         Life = 99999999;
00031                         specificite = 5;
00032                         mutation = false;
00033                 }
00034                 
00035                 public InfectVIH(int x, int y, int life) : base(x,y)
00036                 {
00037                         Life = life;
00038                         specificite = 5;
00039                         mutation = false;
00040                 }
00041 
00042                 public InfectVIH(int x, int y, bool mute) : base(x,y)
00043                 {
00044                         Life = 99999999;
00045                         specificite = 5;
00046                         mutation = mute;
00047                 }
00048 
00049                 new public void Action()
00050                 {
00051                         Mouvement();
00052                         if(rnd.Next(200)==1) 
00053                         {
00054                                 for(int a=0;a<rnd.Next(1,3);a++)
00055                                 {
00056                                         ProdVIH();
00057                                 }
00058                         }
00059                         return;
00060                 }
00061 
00062                 private void ProdVIH()
00063                 {
00064                         int x = rnd.Next(-5,5);
00065                         int y = rnd.Next(-5,5);
00066                         VIH ivih = new VIH(Location.X+x,Location.Y+y,mutation);
00067                         frmMain.ccol.Add(ivih);
00068                 }
00069 
00070                 private void Mouvement()
00071                 {
00072                         int tmp = rnd.Next(2);
00073                         int x,y;
00074                         if(tmp == 0)
00075                         {
00076                                 x = this.Location.X + rnd.Next(-5,5);
00077                                 y = this.Location.Y + rnd.Next(-5,5);
00078                         }
00079                         else
00080                         {
00081                                 x = this.Location.X - rnd.Next(-5,5);
00082                                 y = this.Location.Y - rnd.Next(-5,5);
00083                         }
00084                         this.Location.X = x;
00085                         this.Location.Y = y;
00086                 }
00087         }
00088 }

Generated on Sat Jun 4 15:03:41 2005 for SimImmuno by  doxygen 1.4.2