Пример #1
0
 /// <summary>
 /// Filialo konstruktorius su parametrais
 /// </summary>
 /// <param name="race">Rasė</param>
 /// <param name="town">Miestas</param>
 public Branch(string race, string town)
 {
     Race   = race;
     Town   = town;
     Heroes = new HeroContainer();
     NPCs   = new NPCContainer();
 }
Пример #2
0
    // Use this for initialization
    void Awake()
    {
        Type[] npcTypes = { typeof(NPC) };

        XmlSerializer serializer = new XmlSerializer(typeof(NPCContainer), npcTypes);
        TextReader    textReader = new StreamReader(Application.streamingAssetsPath + "/Npcs.xml");

        npcContainer = (NPCContainer)serializer.Deserialize(textReader);

        textReader.Close();

        /*KeyValuePair<string, int> test = new KeyValuePair<string, int>("Legs", 0);
         * var list = new List<KeyValuePair<string, int>>();
         * list.Add(test);
         *
         * NPC npc = new NPC(0, false, "light", string.Empty, string.Empty, string.Empty, list);
         *
         * npcContainer.Npcs.Add(npc);
         *
         * System.Type[] itemTypes = { typeof(Equipment), typeof(Weapon), typeof(Consumable) };
         *
         *
         * FileStream fs = new FileStream(Path.Combine(Application.streamingAssetsPath, "Npcs.xml"), FileMode.Create);
         * serializer.Serialize(fs, npcContainer);
         * fs.Close();*/
    }
Пример #3
0
 private void Awake()
 {
     Instance      = this;
     pool          = GetComponent <ObjectPool>();
     ShopContainer = new NPCContainer(ShopTrans, this);
     BagContainer  = new NPCContainer(BagTrans, this);
     TeamContainer = new NPCContainer(TeamTrans, this);
 }
Пример #4
0
        }                                      //NPCs konteineris

        /// <summary>
        /// Filialo konstruktorius
        /// </summary>
        public Branch()
        {
            Heroes = new HeroContainer();
            NPCs   = new NPCContainer();
        }
Пример #5
0
    // Use this for initialization
    void Awake()
    {
        Type[] npcTypes = { typeof(NPC) };

        XmlSerializer serializer = new XmlSerializer(typeof(NPCContainer), npcTypes);
        TextReader textReader = new StreamReader(Application.streamingAssetsPath + "/Npcs.xml");

        npcContainer = (NPCContainer)serializer.Deserialize(textReader);

        textReader.Close();

        /*KeyValuePair<string, int> test = new KeyValuePair<string, int>("Legs", 0);
        var list = new List<KeyValuePair<string, int>>();
        list.Add(test);

        NPC npc = new NPC(0, false, "light", string.Empty, string.Empty, string.Empty, list);

        npcContainer.Npcs.Add(npc);

        System.Type[] itemTypes = { typeof(Equipment), typeof(Weapon), typeof(Consumable) };

        FileStream fs = new FileStream(Path.Combine(Application.streamingAssetsPath, "Npcs.xml"), FileMode.Create);
        serializer.Serialize(fs, npcContainer);
        fs.Close();*/
    }
Пример #6
0
 /// <summary>
 /// Constructor of the level
 /// </summary>
 /// <param name="gameInstance">Reference to the game</param>
 public Level(XNADash gameInstance)
 {
     game         = gameInstance;
     factory      = new TileFactory(game);
     npcContainer = new NPCContainer();
 }