00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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 }