コード例 #1
0
    public int StartSurge(MapCoords startPoint, int startPower)
    {
        if (dirtyCache)
        {
            UpdatePowerStructureCaches(startPoint, startPower);
            dirtyCache = false;
        }
        int pollution = 0;

        foreach (PowerableStructure p in powerableCache)
        {
            pollution += p.Power();
        }

        foreach (PowerCarrier p in powerCarrierCache)
        {
            if (p is Conduit)
            {
                Conduit c = p as Conduit;
                c.startSurge();
            }
        }

        return(pollution);
    }