Esempio n. 1
0
    public override bool Equals(object obj)
    {
        ProducesCargo other = (ProducesCargo)obj;

        return(this.CargoType == other.CargoType &&
               this.maxProduced == other.maxProduced &&
               this.direction == other.direction &&
               this.startingAmount == other.startingAmount &&
               this.timeToProduce == other.timeToProduce);
    }
Esempio n. 2
0
    /// <summary>
    /// Spawns and Configs a CargoSprite/s depending on ProducesCargo
    /// Only used for ProducesCargo Sprites
    /// </summary>
    /// <param name="pc"></param>
    void SpawnAndConfigCargoSpriteProduces(ProducesCargo pc)
    {
        pc.amountOfItems = pc.startingAmount;

        if (!dontSpawnAnything)
        {
            foreach (CardinalPoint cp in pc.direction)
            {
                GameObject  GO = SpawnCargoSprite(cp);
                CargoSprite cs = GO.GetComponent <CargoSprite>();
                if (GameConfig.s != null)
                {
                    SpawnArrow(cp, GameConfig.s.cargoColors[(int)pc.CargoType], false);
                }
                else
                {
                    SpawnArrow(cp, Color.white, false);
                }

                pc.myCargoSpriteReference.Add(cs);
            }
        }

        pc.myBuilding       = this;
        OnTruckLoadStation += pc.TruckOnPointListener;
        if (pc.needsIncome)
        {
            OnTruckUnloaded += pc.TruckOnPointListenerINCOME;
        }
        pc.UpdateMyCargoSprites();
        pc.Initialize();



        //cs.Initialize();
    }