예제 #1
0
 public void CacheCataloguesObject(CataloguePool cpool)
 {
     foreach (Catalogue c in cpool.All)
     {
         CacheMusicCatalogue(c);
     }
 }
 public void Initialize()
 {
     mlp  = MusicListPool.INSATNCE;
     cpl  = CataloguePool.INSATNCE;
     mmdr = new MediaMetaDataReader();
     mlp.AddToPool(@"F:\M2\", mmdr);
 }
예제 #3
0
        private void InitializeModules()
        {
            mlp         = MusicListPool.INSATNCE;
            CPOOL       = CataloguePool.INSATNCE;
            laudio      = LpsAudio.INSTANCE();
            cacheSystem = CacheHub.INSTANCE(Environment.CurrentDirectory);
            converter   = I18NConvertor.INSTANCE(I18NPages.INSTANCE);
            //mmdr = new MediaMetaDataReader(converter);
            //mlp.AddToPool("F:/M2", mmdr);

            //intp = Interpreter.INSTANCE(@"F:\Lunalipse\TestUnit\bin\Debug");
            //if (intp.Load("prg2"))
            //{
            //    PlayFinished();
            //}
            //alb.Source = mlp.ToCatalogue().GetCatalogueCover();
            AudioDelegations.PlayingFinished += PlayFinished;
            AudioDelegations.MusicLoaded     += MusicPerpeared;
            dipMusic.ItemSelectionChanged    += DipMusic_ItemSelectionChanged;
            ControlPanel.OnTrigging          += ControlPanel_OnTrigging;
            AudioDelegations.PostionChanged  += NotifyChanged;
            ControlPanel.Value              = 0;
            laudio.Volume                   = (float)ControlPanel.Value;
            ControlPanel.OnProgressChanged += ControlPanel_OnProgressChanged;
            ControlPanel.OnVolumeChanged   += ControlPanel_OnVolumeChanged;
            CATALOGUES.OnSelectionChange   += CATALOGUES_OnSelectionChange;
            CATALOGUES.TheMainCatalogue     = mlp.ToCatalogue();
            cacheSystem.RegisterOperator(CacheType.MUSIC_CATALOGUE_CACHE, new MusicCacheIndexer()
            {
                UseLZ78Compress = true
            });
        }
예제 #4
0
 public static MusicEntity PROC_LUNA_SET(int type, object[] args, CataloguePool cp, ref Catalogue chosen, ref int ptr)
 {
     if (type == (int)DefinedCmd.LUNA_SET)
     {
         chosen = cp.GetCatalogueFirst(args[0] as string);
         return(null);
     }
     return(null);
 }
예제 #5
0
 public static MusicEntity PROC_LUNA_LLOOP(int type, object[] args, CataloguePool cp, ref Catalogue chosen, ref int ptr)
 {
     if (type == (int)DefinedCmd.LUNA_LLOOP)
     {
         ptr = 0;
         return(null);
     }
     return(null);
 }
예제 #6
0
        public void ImporterTest()
        {
            GeneralImporter <CataloguePool> importer = new GeneralImporter <CataloguePool>("export.ld");
            CataloguePool cp = importer.Import();

            Assert.IsNotNull(cp);
            foreach (MusicEntity me in cp.GetCatalogue(0).MusicList)
            {
                PrintClass(typeof(MusicEntity), me);
            }
        }
예제 #7
0
 public static MusicEntity PROC_LUNA_PLAYC(int type, object[] args, CataloguePool cp, ref Catalogue chosen, ref int ptr)
 {
     if (type == (int)DefinedCmd.LUNA_PLAYC)
     {
         if (args.Length > 2)
         {
             LpsAudio.AudioDelegations.ChangeVolume((float)args[2] / 100f);
         }
         return(cp.GetCatalogueFirst(args[0] as string).getMusic(ScriptUtil.RemoveExtension(args[1] as string)));
     }
     return(null);
 }
예제 #8
0
    private void Awake()
    {
        //Get main camera;
        camera = Camera.main;

        List <RoadTile> tilePrefabs = new List <RoadTile>();

        activeTileMap = new Dictionary <Vector2, RoadTile>();

        prefabObjects.RemoveAll((t) =>
        {
            RoadTile tile = t.GetComponent <RoadTile>();

            if (tile != null)
            {
                tilePrefabs.Add(tile);
            }
            return(tile == null);
        }
                                );

        Dictionary <RoadTile.Type, RoadTile> tileCatalogue = new Dictionary <RoadTile.Type, RoadTile>();

        foreach (RoadTile tile in tilePrefabs)
        {
            if (!tileCatalogue.ContainsKey(tile.TileType))
            {
                tileCatalogue.Add(tile.TileType, tile);
            }
        }

        roadTilePool = new CataloguePool <RoadTile.Type, RoadTile>(initialCountFromEach, transform, tileCatalogue);
        foreach (RoadTile tile in roadTilePool.InitializePool())
        {
            tile.InitializeAsPoolItem();
        }

        Rotator rotator = rotatorPrefab.GetComponent <Rotator>();

        rotatorPool = new SingularPool <Rotator>(initialCountFromEach, transform, rotator);
        foreach (Rotator item in rotatorPool.InitializePool())
        {
            item.InitializeAsPoolItem();
        }

        InstallTile(RoadTile.Type.Straight, Vector3.zero, Vector3.forward);
        standingTilePosition = lastOutDirection;
        lastOutDirection     = GetNewOutDirection(RoadTile.Type.Straight, lastOutDirection);


        Generate();
    }
예제 #9
0
 public static MusicEntity PROC_LUNA_NEXT(int type, object[] args, CataloguePool cp, ref Catalogue chosen, ref int ptr)
 {
     if (type == (int)DefinedCmd.LUNA_NEXT)
     {
         if (chosen == null)
         {
             chosen = cp.GetCatalogue(0);
         }
         if (args.Length > 2)
         {
             LpsAudio.AudioDelegations.ChangeVolume((float)args[2] / 100f);
         }
         return(chosen.getNext());
     }
     return(null);
 }
예제 #10
0
    private void Start()
    {
        //Get main camera;
        camera = Camera.main;

        List <BallPlatformTile> tilePrefabs = new List <BallPlatformTile>();

        prefabTiles.RemoveAll((t) =>
        {
            BallPlatformTile tile = t.GetComponent <BallPlatformTile>();

            if (tile != null)
            {
                tilePrefabs.Add(tile);
            }
            return(tile == null);
        }
                              );

        Dictionary <int, BallPlatformTile> tileCatalogue = new Dictionary <int, BallPlatformTile>();

        foreach (BallPlatformTile tile in tilePrefabs)
        {
            if (!tileCatalogue.ContainsKey(tile.Type))
            {
                tileCatalogue.Add(tile.Type, tile);
            }
        }

        tilePool = new CataloguePool <int, BallPlatformTile>(initialCountFromEach, transform, tileCatalogue);
        foreach (BallPlatformTile tile in tilePool.InitializePool())
        {
            tile.InitializeAsPoolItem(true);
        }

        Pickup pickup = prefabPickup.GetComponent <Pickup>();

        pickupPool = new SingularPool <Pickup>(initialCountFromEach, transform, pickup);
        foreach (Pickup item in pickupPool.InitializePool())
        {
            item.InitializeAsPoolItem();
        }

        GenerateTiles();
    }
예제 #11
0
        protected Interpreter()
        {
            ScriptParser = new Parser();
            KbProxy      = KeyboardProxy.INSTANCE;
            CataPool     = CataloguePool.INSATNCE;
            Helper       = new Interpretation();
            ScriptParser.ErrorOccured += (x, y, z) =>
            {
                ErrorDelegation.OnErrorRaisedBSI?.Invoke(x, y, z);
            };
            ScriptParser.MarcoProcessor = MarcoHandler;

            //Register Lunalipse Behavior Script Instructions
            onCExecutionRequest += InstructionProc.PROC_LUNA_PLAY;
            onCExecutionRequest += InstructionProc.PROC_LUNA_PLAYN;
            onCExecutionRequest += InstructionProc.PROC_LUNA_PLAYC;
            onCExecutionRequest += InstructionProc.PROC_LUNA_NEXT;
            onCExecutionRequest += InstructionProc.PROC_LUNA_LLOOP;
            onCExecutionRequest += InstructionProc.PROC_LUNA_SET;

            //Register Lunalipse Behavior Script Suffix Instructions
            onSExecutionRequest += InstructionProc.PROC_SUFX_COUNT;
            onSExecutionRequest += InstructionProc.PROC_SUFX_RAND;

            //Register Key Press Event
            KbProxy.RegistKeyEvent(new KeyEventProc()
            {
                Name            = "CORE_LBS_SWITCHRAND_KEYPRESS",
                ModifierKey     = (int)Keys.Alt,
                SubKey          = (int)Keys.Z,
                WaitRelease     = false,
                ProcInvoke_Down = KeyPressed
            });

            //Register for Lunalipse prompt
            ConsoleAdapter.INSTANCE.RegisterComponent("lbsi", this);
        }
예제 #12
0
 public static MusicEntity PROC_LUNA_PLAYN(int type, object[] args, CataloguePool cp, ref Catalogue chosen, ref int ptr)
 {
     if (type == (int)DefinedCmd.LUNA_PLAYN)
     {
         if (chosen == null)
         {
             chosen = cp.GetCatalogue(0);
         }
         if (args.Length > 1)
         {
             LpsAudio.AudioDelegations.ChangeVolume((float)args[1] / 100f);
         }
         int num = (int)args[0];
         if (num < 0)
         {
             return(chosen.getMusic(new Random().Next(0, chosen.GetCount())));
         }
         else
         {
             return(chosen.getMusic(num));
         }
     }
     return(null);
 }