예제 #1
0
    void InitializeData()
    {
        heroDatabase = HeroDatabase.Instance;
        heroDatabase.InitializeHeroDatabase();
        itemDatabase = ItemDatabase.Instance;
        itemDatabase.InitializeItemDatabase();
        buildingDatabase = BuildingDatabase.Instance;
        buildingDatabase.InitializeBuildingDatabase();
        unitDatabase = UnitDatabase.Instance;
        unitDatabase.InitializeUnitDatabase();

        Id          = "";
        heroData    = new HeroBaseData();
        resource    = 0;
        heroState   = 0;
        castleState = 0;

        equipment    = new int[equipNum];
        inventoryId  = new int[invenNum];
        inventoryNum = new int[invenNum];
        skill        = new int[skillNum];
        unit         = new Unit[unitNum];
        createUnit   = new Unit();
        attackUnit   = new Unit[unitNum];
        building     = new int[buildingNum];
        upgrade      = new int[unitNum];

        buildBuilding = buildingNum;
    }
예제 #2
0
    public Database()
    {
        bin = new BinaryFormatter();
        fs  = new FileStream(accountDataFile, FileMode.OpenOrCreate);

        accountData  = GetData(accountDataFile);
        worldMapData = GetData(worldMapDataFile);

        userData = new Hashtable();

        buildingDatabase = BuildingDatabase.Instance;
        buildingDatabase.InitializeBuildingDatabase();
        unitDatabase = UnitDatabase.Instance;
        unitDatabase.InitializeUnitDatabase();
        InitializeWorldMapData();
    }