Exemple #1
0
    public override void ManageStream()
    {
        if (this.Stream.GetState != this.StreamprocessingType)
        {
            StreamPool.returnStream(this.Stream);
            this.ChangeState = runningState.incorrectInput;
            return;
        }

        //  myAnimator.setAnimState(this);
        this.PassStream();
    }
Exemple #2
0
 public void StopRunning()
 {
     animState = runningState.notRunning;
     myState   = runningState.notRunning;
     //animColor = streamColor.notSet;
     if (myStream != null)
     {
         StreamPool.returnStream(myStream);
         myStream = null;
     }
     ManageAnimator();
 }
Exemple #3
0
    public override void ManageStream()
    {
        if (this.Stream.GetState != this.StreamprocessingType)
        {
            StreamPool.returnStream(this.Stream);
            this.ChangeState = runningState.incorrectInput;
            return;
        }

        StreamModifier myMod = new StreamModifier(myMultiplier);

        this.Stream.AddModifier = myMod;


        //  myAnimator.setAnimState(this);
        this.PassStream();
    }
    public override void ManageStream()
    {
        if (this.Stream.GetState != this.StreamprocessingType)
        {
            StreamPool.returnStream(this.Stream);
            this.ChangeState = runningState.incorrectInput;
            return;
        }


        //  base.ManageStream();
        isRecivingStream = true;
        ResourceStream myStream      = this.Stream;
        float          myStreamValue = myStream.GetStreamValue();

        ResourceManager.rManager.curResource += myStreamValue;
        StreamPool.returnStream(this.Stream);
        //Destroy (myStream); //This is temp until I set up object pooling
        // Debug.LogError("Should be better");
    }
Exemple #5
0
    public void PassStream()
    {
        //   Debug.Log(this.transform.name + "Is passing OBJ");

        myNeighbors.Clear();
        MyNeighborOutPut.Clear();
        for (int output = 0; output < myOutputs.Count; output++)
        {
            // Debug.Log(myOutputs[output]);
            if (myParent.GetNeighbor(myOutputs[output]) != null)
            {
                if (myInputs.Contains(myOutputs[output]))
                {
                    myInputs.Remove(myOutputs[output]);
                }
                myNeighbors.Add(myParent.GetNeighbor(myOutputs [output]));
                MyNeighborOutPut.Add(myOutputs [output]);
                // .ReceiveStream(myStream, myOutputs[output]);

                // return;
            }
        }
        //Debug.Log (myStream.currentValue);
        //myStream.currentValue = myStream.currentValue / myNeighbors.Count + 1;
        //Debug.Log (myStream.currentValue + " : " + myNeighbors.Count);
        if (myNeighbors.Count > 0)
        {
            myState = runningState.running;
            for (int neighbor = 0; neighbor < myNeighbors.Count; neighbor++)
            {
                myNeighbors [neighbor].ReceiveStream(myStream, MyNeighborOutPut [neighbor]);
            }
        }
        else
        {
            StreamPool.returnStream(this.Stream);
            myState = runningState.incorrectOutput;
        }
        ManageAnimator();
    }