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 CI : Cellule
00025 {
00026 public CI(int x, int y) : base(x,y)
00027 {
00028 Life = 1000;
00029 }
00030
00031 public CI(int x, int y, int life) : base(x,y)
00032 {
00033 Life = life;
00034 }
00035
00036 new public void Action()
00037 {
00038 Mouvement();
00039 return;
00040 }
00041
00042 private void Mouvement()
00043 {
00044 int tmp = rnd.Next(2);
00045 int x,y;
00046 if(tmp == 0)
00047 {
00048 x = this.Location.X + rnd.Next(-5,5);
00049 y = this.Location.Y + rnd.Next(-5,5);
00050 }
00051 else
00052 {
00053 x = this.Location.X - rnd.Next(-5,5);
00054 y = this.Location.Y - rnd.Next(-5,5);
00055 }
00056 this.Location.X = x;
00057 this.Location.Y = y;
00058 }
00059 }
00060 }