Пример #1
0
        public override MobileState GetMobileState(int index)
        {
            if (index < Constants.TANK_COUNT)
            {
                TankState tankState = TankStates[index];
                if (tankState == null)
                {
                    return(new MobileState());  // IsActive will be false
                }
                return(tankState.GetMobileState());
            }
            int         bulletIndex = index - Constants.TANK_COUNT;
            BulletState bulletState = BulletStates[bulletIndex];

            if (bulletState == null)
            {
                return(new MobileState());  // IsActive will be false
            }
            return(bulletState.GetMobileState());
        }