- Added message structure
This commit is contained in:
Tristan B. Velloza Kildaire 2023-11-19 21:13:05 +02:00
parent 6a493eb29c
commit cd6c07d209
1 changed files with 16 additions and 0 deletions

View File

@ -1,12 +1,28 @@
module renaissance.server.messagemanager;
import renaissance.server.server : Server;
import std.container.slist : SList;
public struct Message
{
private string destination;
private string message;
private string from;
this(string destination, string from, string message)
{
this.destination = destination;
this.from = from;
this.message = message;
}
}
public enum QUEUE_DEFAULT_SIZE = 100;
public class Queue
{
private size_t maxSize;
private SList!(Message) queue;
public this(size_t maxSize = QUEUE_DEFAULT_SIZE)
{