Example #1
0
    /// <summary> Constructor directly interprets the Data structures </summary>
    /// <param name="data"> The datastructure in question </param>
    public Chapter(DataStructure data)
    {
        //UnityEngine.Debug.Log(data);

        NMS.OS.OperatingSystem os = Globals.current_os;

        name           = data.Get <string>("name", quiet: true);
        directory_name = "campagne/" + data.Get <string>("directory", quiet: true) + "/";

        List <ChapterBattle>       battle_list       = new List <ChapterBattle>();
        List <ChapterConversation> conversation_list = new List <ChapterConversation>();
        List <ChapterJump>         jump_list         = new List <ChapterJump>();

        foreach (DataStructure child in data.AllChildren)
        {
            switch (child.Name)
            {
            case "battle":
                DataStructure datastr = DataStructure.Load(directory_name + child.Get <string>("filename"), parent: child);
                battle_list.Add(new ChapterBattle()
                {
                    AviableOn   = child.Get <ushort[]>("aviable"),
                    Name        = child.Get <string>("name"),
                    path        = directory_name + child.Get <string>("filename"),
                    own_data    = datastr,
                    planet_name = child.Get("planet", "Trantor"),
                    progress    = child.Get <ushort>("progress", 0),
                });
                break;

            case "conversation":
                conversation_list.Add(new ChapterConversation()
                {
                    AviableOn = child.Get <ushort []>("aviable"),
                    Name      = child.Get <string>("name"),
                    own_data  = child,
                    progress  = child.Get <ushort>("progress"),
                });
                break;

            case "jump chapter":
                jump_list.Add(new ChapterJump()
                {
                    AviableOn   = child.Get <ushort []>("aviable"),
                    Name        = child.Get <string>("name"),
                    new_chapter = child.Get <string>("chapter name"),
                });
                break;
            }
        }

        battles       = battle_list.ToArray();
        conversations = conversation_list.ToArray();
        jumps         = jump_list.ToArray();

        all_events = new IChapterEvent [battles.Length + conversations.Length + jumps.Length];
        battles.CopyTo(all_events, 0);
        conversations.CopyTo(all_events, battles.Length);
        jumps.CopyTo(all_events, battles.Length + conversations.Length);
    }
Example #2
0
        public CPU(Ship p_ship, OS.OperatingSystem p_os)
        {
            ship = p_ship;
            os   = p_os;

            ram = new RAM(0x1000);
        }
Example #3
0
    private void UpdateOnMenu()
    {
        Globals.audio = FindObjectOfType <AudioManager>();
        ConsoleBehaviour console = FindObjectOfType <ConsoleBehaviour>();

        console.Start_();

        base_os            = new NMS.OS.OperatingSystem(console, null);
        Globals.current_os = base_os;

        is_updatemenu = false;
    }
Example #4
0
    /// <param name="ship"> The gameobject representing the ship </param>
    public Ship(GameObject ship_obj, bool friendly, string name, int id = -1) : base(SceneObjectType.ship, id)
    {
        Friendly   = friendly;
        Object     = ship_obj;
        Name       = name + ID.ToString("[0000]");
        Associated = new Target(this);

        Parts = new PartsCollection();

        MapCore.Active.ObjectSpawned(this);
        SceneGlobals.ship_collection.Add(this);

        os          = new NMS.OS.OperatingSystem(null, this);
        os.Attached = this;
    }