GodotTicTacToe/scripts/Peer.cs

22 lines
559 B
C#
Raw Normal View History

2017-11-21 18:33:48 +01:00
using Godot;
public abstract class Peer : Object {
private PacketPeerUDP PacketPeer;
private int LastConnectionSended = -1;
public Peer(PacketPeerUDP packetPeer) {
PacketPeer = packetPeer;
}
public abstract void Initialize(string address, int port);
public abstract void Update(float delta);
public void SendBuffer(byte[] buffer, Connection to) {
GD.print("Putting stuff to " + to.Address + ":" + to.Port);
PacketPeer.SetDestAddress(to.Address, to.Port);
PacketPeer.PutPacket(buffer);
}
}