void Start() { Head = new BufferEmpty(); restartTimer = false; timerGoing = false; length = 0; }
public CircularBuffer() { CurrentPosition = new BufferNode() { Value = 0 }; CurrentPosition.Next = CurrentPosition; }
public BufferNode InsertAfter(int newValue) { var newNode = new BufferNode { Value = newValue, Next = Next }; this.Next = newNode; return(newNode); }
public FarmDataRoot() { Guid = Guid.NewGuid(); Block = new BlockNode(); Buffer = new BufferNode(); TempValueNode = new ValueNode(); }
public FarmDataRoot(BlockNode.BLOCK_NAME block_name, BufferNode.BUFFER_NAME buffer_name) { Guid = Guid.NewGuid(); Block = new BlockNode(block_name); Buffer = new BufferNode(buffer_name); TempValueNode = new ValueNode(); }
public void AddCons(char val) { /*if (val == Head.Val) { * return; * }*/ Head = new BufferCons(val, Head); length += 1; if (timerGoing) { restartTimer = true; } else { StartCoroutine(ClearNext()); } }
public void ShowCurrentBuffer(BufferNode head) { BufferNode current = head; string readout = ""; // while(!current.IsEmpty()) { Debug.Log(Buffer.length); for (int i = 0; i < Buffer.length; i++) { if (readout != "") { readout += ", "; } readout += current.Val; current = head.GetNext(); } TM.text = readout; }
private IEnumerator ClearNext() { timerGoing = true; for (float i = 0; i < LIFESPAN; i += Time.deltaTime) { if (restartTimer) { restartTimer = false; StartCoroutine(ClearNext()); yield break; } yield return(null); } if (!Head.IsEmpty()) { Head = Head.GetNext(); length -= 1; StartCoroutine(ClearNext()); } else { timerGoing = false; } }
public BufferCons(char val, BufferNode next) { Val = val; Next = next; }
public void StepForward() { CurrentPosition = CurrentPosition.Next; }
// Use this for initialization protected void Start() { Val = '\0'; Next = null; }
/// <summary> /// Adds a new Buffer to the system. /// </summary> /// <param name="node"></param> public void AddBuffer(BufferNode node) { this.buffers.Add(nextBuffer, node); nextBuffer++; }