Difference between revisions of "EEvent"

From Armagetron
(goals & milestones)
 
(→‎Implementation: documented my planned implementation)
Line 12: Line 12:
  
 
==Milestones==
 
==Milestones==
 
 
* Working sound
 
* Working sound
 
* Event resources
 
* Event resources
 
* External communication
 
* External communication
 +
 +
==Implementation==
 +
===eEvent class===
 +
That's the object that will the thrown all the way, it doesn't collect a lot of info, but it collects all which is necessary to execute it(triggering what it is supposed to trigger) or to transmit it.
 +
 +
=====Friends=====
 +
* eEventType
 +
 +
=====[protected] eEventContext context=====
 +
Describes the network context the eEvent is found in. An eEventContext is a simple struct, detailled later. This about this as IE's security zones(or whatever they call it), but keep positive about it :)
 +
 +
=====[private] eEventType type=====
 +
That's the eEvent's type, what makes it different from another eEvent. An eEventType is what contains the event's type string (ie. zone_conquered) and what actions it triggers.
 +
 +
=====[private] eEventArgumentList args=====
 +
List of the eEvent's arguments :)
 +
typedef eEventArgumentList std::map< int, vValue >;
 +
 +
=====[public] void Execute( void )=====
 +
Executes the event.
 +
 +
=====[public] Broadcast ( void )=====
 +
Broadcasts the event.
 +
 +
That's about it. That's not much is it? :)
 +
 +
===eEventContext struct===
 +
 +
enum eEventContextComponent
 +
{
 +
  eEventContext_me      = 0,
 +
  eEventContext_server  = 1,
 +
  eEventContext_client  = 2,
 +
  eEventContext_external = 3,
 +
}
 +
 +
=====[public] eEventContextComponent sender=====
 +
The sender.
 +
 +
=====[public] eEventContextComponent receiver=====
 +
The receiver.
 +
 +
===eEventType===

Revision as of 17:31, 21 July 2008

This wiki page has an associated Blueprint on launchpad.

At the time I'm writing this, there's absolutely no way the client can know what's really happening. Until now, the only thing that's different (from the client's view) between a harmless collapse and a base conquer is that it got a different message in English. That poses a great problem as soon as you want, for example, play a different sound depending on what happened. You can't just use the same sound for these both game events.

So here's my solution to this, having, the same way we separate content and presentation in webdesign, we'll separate the actual event and what to do when it happens. So at one side we have the server telling the client that event X happened, on the other side an event resource describing what to do when event X or Y is received.

Goals

  • Get a working sound engine :)
  • Modular approach, especially needed for event resources
  • Future-Proof, as in, you can make up new kinds of event types
  • Event description resources
  • Client/Server AND Server/External service communication

Milestones

  • Working sound
  • Event resources
  • External communication

Implementation

eEvent class

That's the object that will the thrown all the way, it doesn't collect a lot of info, but it collects all which is necessary to execute it(triggering what it is supposed to trigger) or to transmit it.

Friends
  • eEventType
[protected] eEventContext context

Describes the network context the eEvent is found in. An eEventContext is a simple struct, detailled later. This about this as IE's security zones(or whatever they call it), but keep positive about it :)

[private] eEventType type

That's the eEvent's type, what makes it different from another eEvent. An eEventType is what contains the event's type string (ie. zone_conquered) and what actions it triggers.

[private] eEventArgumentList args

List of the eEvent's arguments :)

typedef eEventArgumentList std::map< int, vValue >;
[public] void Execute( void )

Executes the event.

[public] Broadcast ( void )

Broadcasts the event.

That's about it. That's not much is it? :)

eEventContext struct

enum eEventContextComponent
{
 eEventContext_me       = 0,
 eEventContext_server   = 1,
 eEventContext_client   = 2,
 eEventContext_external = 3,
}
[public] eEventContextComponent sender

The sender.

[public] eEventContextComponent receiver

The receiver.

eEventType