Beispiel #1
0
    private void Awake()
    {
        this.registeredStats = new List <RegisteredStat>();

        // General Stats:
        this.leversFlipped      = this.registerStat(new StatisticInt("Levers Flipped", "leversFlipped"), EnumStatisticCategory.GENERAL);
        this.minecartsPlaced    = this.registerStat(new StatisticInt("Minecarts Placed", "minecartsPlaced"), EnumStatisticCategory.GENERAL);
        this.minecartsDestroyed = this.registerStat(new StatisticInt("Minecarts Destroyed", "minecartsDestroyed"), EnumStatisticCategory.GENERAL);

        // Worker Stats:
        this.workersHired = this.registerStat(new StatisticInt("Workers Hired", "workersHired"), EnumStatisticCategory.WORKERS);
        this.workersFired = this.registerStat(new StatisticInt("Workers Fired", "workersFired"), EnumStatisticCategory.WORKERS);

        // Tile Stats:
        TileRegistry reg = Main.instance.tileRegistry;

        for (int i = 0; i < reg.getRegistrySize(); i++)
        {
            CellData cell = reg.getElement(i);
            if (cell != null)
            {
                this.registerStat(new StatisticInt(cell.displayName + " built", cell.name + DOT_TIMES_BUILT), EnumStatisticCategory.TILES);

                if (cell is CellDataMineable)
                {
                    this.registerStat(new StatisticInt(cell.displayName + " mined", cell.name + DOT_TIMES_MINED), EnumStatisticCategory.TILES);
                }

                if (cell.isDestroyable)
                {
                    this.registerStat(new StatisticInt(cell.displayName + " destroyed", cell.name + DOT_TIMES_DESTROYED), EnumStatisticCategory.TILES);
                }
            }
        }
    }