Eigenen Buffer geschrieben (WIP)
This commit is contained in:
43
src/Buffer_Wafa.cs
Normal file
43
src/Buffer_Wafa.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WorldOfPeacecraft
|
||||
{
|
||||
public class Buffer
|
||||
{
|
||||
private Queue<string> DotA2 = new Queue<string> ();
|
||||
private int sizelimit;
|
||||
|
||||
public Buffer (int limit)
|
||||
{
|
||||
sizelimit = limit;
|
||||
}
|
||||
|
||||
bool isEmpty(){
|
||||
if (DotA2.Count == 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isFull(){
|
||||
if (DotA2.Count >= sizelimit)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
string popMessage(){
|
||||
//TODO
|
||||
}
|
||||
|
||||
void enqueueMessage (string servermessage){
|
||||
if (isFull == false) {
|
||||
DotA2.Enqueue (servermessage);
|
||||
} else {
|
||||
//this is else
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user