Пример #1
0
        public ProjectileType Get(string Name)
        {
            ProjectileType Result = new ProjectileType();

            for (int i = 0; i < ProjectileTypes.Count(); i++)
            {
                if (ProjectileTypes[i].Name == Name)
                {
                    Result = ProjectileTypes[i];
                    i      = ProjectileTypes.Count();
                }
            }
            return(Result);
        }
Пример #2
0
        public virtual void Create(string[] param, ContentHolder TCH)
        {
            int       rof         = Convert.ToInt32(param[0]);
            string    PTName      = param[1];
            Texture2D PTPic       = TCH.GetTexture(param[2]);
            int       LaunchSpeed = Convert.ToInt32(param[3]);
            int       Damage      = Convert.ToInt32(param[4]);
            int       GunEndX     = Convert.ToInt32(param[5]);
            int       GunEndY     = Convert.ToInt32(param[6]);
            int       AimGunEndX  = Convert.ToInt32(param[7]);
            int       AimGunEndY  = Convert.ToInt32(param[8]);

            ProjectileTypes = new List <ProjectileType>();
            ProjectileType PT = new ProjectileType();

            PT.Create(PTName, PTPic, null, LaunchSpeed, Damage);
            ProjectileTypes.Add(PT);
            ROF       = (float)rof;
            ShotTime  = 1 / ROF;
            GunEnd    = new Vector2((float)GunEndX, (float)GunEndY);
            AimGunEnd = new Vector2((float)AimGunEndX, (float)AimGunEndY);
        }