void ProcessFlag(MyEntity entity, MyFlagsEnum flag, bool param)
        {
            switch (flag)
            {
            case MyFlagsEnum.ENABLE:
                entity.Enabled = true;
                break;

            case MyFlagsEnum.DISABLE:
                entity.Enabled = false;
                break;

            case MyFlagsEnum.HIDE:
                entity.Activate(false, param);
                break;

            case MyFlagsEnum.UNHIDE:
                entity.Activate(true, param);
                break;

            case MyFlagsEnum.PARK_SHIP:
            {
                var ship = entity as MySmallShip;
                if (ship != null)
                {
                    ship.SetParked(param);
                }
            }
            break;

            case MyFlagsEnum.CLOSE:
                MyScriptWrapper.CloseEntity(entity);
                break;

            case MyFlagsEnum.PARTICLE:
                MyScriptWrapper.SetParticleEffect(entity, param);
                break;

            case MyFlagsEnum.NUCLEAR_EXPLOSION:
                MyScriptWrapper.MakeNuclearExplosion(entity);
                break;

            case MyFlagsEnum.INDESTRUCTIBLE:
                entity.IsDestructible = false;
                break;

            case MyFlagsEnum.DESTRUCTIBLE:
                entity.IsDestructible = true;
                break;

            case MyFlagsEnum.PREPARE_MOVE:
                MyScriptWrapper.PrepareMotherShipForMove(entity);
                break;

            case MyFlagsEnum.RETURN_FROM_MOVE:
                MyScriptWrapper.ReturnMotherShipFromMove(entity);
                break;

            default:
                Debug.Fail("Unknown flag");
                break;
            }
        }