Ejemplo n.º 1
0
    public void setAirplaneArchtype(AirplaneArchtype type)
    {
        this.type = type;
        Transform child = transform.Find("SpeedDisplayText");
        Text      t     = child.GetComponent <Text>();

        t.text = "" + type.getSpeed();

        child  = transform.Find("PassengersDisplayText");
        t      = child.GetComponent <Text>();
        t.text = "" + type.getMaxPassengers();

        child  = transform.Find("FuelSizeDisplayText");
        t      = child.GetComponent <Text>();
        t.text = "" + type.getFuelSize();

        child  = transform.Find("AirplaneNameText");
        t      = child.GetComponent <Text>();
        t.text = "" + type.getModelName();

        child  = transform.Find("CostText");
        t      = child.GetComponent <Text>();
        t.text = "" + type.getCost();

        child = transform.Find("PurchaseButton");
        PurchaseButtonHandler handler = child.GetComponent <PurchaseButtonHandler>();

        handler.setType(type);
    }
Ejemplo n.º 2
0
    public bool purchaseAirplane(AirplaneArchtype type)
    {
        if (type.getCost() > this.playerMoney)
        {
            return(false);
        }
        Debug.Log("Buying a " + type.getModelName());
        this.playerMoney -= type.getCost();
        Airplane airplane = new Airplane("DL130", type);

        airplanes.Add(airplane);

        return(true);
    }
Ejemplo n.º 3
0
    private void setupAirplaneArchtypes()
    {
        AirplaneArchtype type1 = new AirplaneArchtype("Penguin", 10, 3, 10000, 15);
        AirplaneArchtype type2 = new AirplaneArchtype("Stork", 50, 3, 10000, 30);
        AirplaneArchtype type3 = new AirplaneArchtype("Pelican", 100, 3, 10000, 100);
        AirplaneArchtype type4 = new AirplaneArchtype("Test", 100, 3, 10000, 100);
        AirplaneArchtype type5 = new AirplaneArchtype("Test", 100, 3, 10000, 100);
        AirplaneArchtype type6 = new AirplaneArchtype("Test", 100, 3, 10000, 100);

        archtypes.Add(type1);
        archtypes.Add(type2);
        archtypes.Add(type3);
        archtypes.Add(type4);
        archtypes.Add(type5);
        archtypes.Add(type6);
    }
Ejemplo n.º 4
0
 public Airplane(string name, AirplaneArchtype type)
 {
     this.name = name;
     this.type = type;
 }
Ejemplo n.º 5
0
 public void setType(AirplaneArchtype type) {
     this.type = type;
 }