示例#1
0
    public void Trigger()
    {
        Triggered = true;

        if (GetsUnblocked)
        {
            TheBlocker.Unblock();
        }

        if (TheTalkable != null)
        {
            TheTalkable.TriggerDialogue(DialogueIndex);
        }

        if (Collider != null)
        {
            Collider.enabled = true;
            WaterTap tap = GetComponent <WaterTap>();
            tap.EnableUsable();
        }

        if (DisappearsOnTrigger)
        {
            this.gameObject.SetActive(false);
        }

        if (Spawns != null)
        {
            Spawns.SetActive(true);
        }

        this.enabled = false;
    }
示例#2
0
 public void Load(WaterTap tap)
 {
     try {
         PersistedWaterSource saved = SavedTaps[tap.PersistenceKey];
         tap.Load(saved.IsOn, saved.IsUsable);
     } catch {}
 }
        public MainWindow()
        {
            InitializeComponent();
            var koffiezetterDisplay = new KoffiezetterDisplay(ReportFunc);

            DisplayGrid.DataContext = koffiezetterDisplay;

            var waterTap   = new WaterTap();
            var waterKoker = new WaterKoker();

            _koffiezetter = new Koffiezetter(koffiezetterDisplay, waterTap, waterKoker);
        }
示例#4
0
    public void WhenWaterContainerIsEmpty_FillingItUp_CausesCorrectWaterLevel()
    {
        // There seems to be no relationship between the container
        // and the tap - so how will the tap cause any change
        // to the container?
        WaterContainer waterC = new WaterContainer(0);
        WaterTap       tap    = new WaterTap();

        // The method that you shared with us is called:
        // FillUpWater, but this is calling FillUpContainer
        waterC = tap.FillUpContainer();
        // You create a variable named:
        // waterC, but use WaterC here (C# is case sensitive)
        Assert.AreEqual(5, WaterC.Level);
    }
示例#5
0
 // Use this for initialization
 void Start()
 {
     sinkScript = sink.gameObject.GetComponent <WaterTap>();
 }
示例#6
0
 public void Save(WaterTap tap)
 {
     SavedTaps[tap.PersistenceKey] = tap.GetPersistedObject();
 }