Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin requires information about the game running #16

Closed
phogue opened this issue Nov 27, 2013 · 1 comment
Closed

Plugin requires information about the game running #16

phogue opened this issue Nov 27, 2013 · 1 comment
Assignees

Comments

@phogue
Copy link
Owner

phogue commented Nov 27, 2013

A plugin requires information about the current game running and what actions/events will come from the game connection.

@ghost ghost assigned phogue Dec 30, 2013
@phogue
Copy link
Owner Author

phogue commented Dec 30, 2013

This is being handled by, what I'm calling, a truth tree. Until I find out the correct name for it anyway.

Each node of the tree can have children and more detail of an action is explained with subsequent children.

            return new Tree() {
                new ProconAgent() {
                    new KnowsWhen() {
                        new PlayerAgent() {
                            new Kills() {
                                // Procon KnowsWhen Player Kills Player
                                new PlayerAgent()
                            },
                            new Chats() {
                                new To() {
                                    // Procon KnowsWhen Player Chats To Server
                                    new ServerAgent(),
                                    // Procon KnowsWhen Player Chats To Group
                                    new GroupAgent()
                                }
                            }
                        }
                    },
                    new CanDo() {
                        new Chats() {
                            new To() {
                                // Procon CanDo Chats To Group
                                new ServerAgent(),
                                // Procon CanDo Chats To Group
                                new GroupAgent(),
                                // Procon CanDo Chats To Player
                                new PlayerAgent()
                            }
                        },
                        new Kills() {
                            new To() {
                                // Procon CanDo Kills to Player
                                new PlayerAgent()
                            }
                        }
                    }
                }
            };

This can then be polled with the following

tree.Exists(new ProconAgent(), new CanDo(), new Chats(), new To(), new GroupAgent());

You can supply it with as much detail as required, so to find out if Procon can in some form send chat to the server you would just do:

tree.Exists(new ProconAgent(), new CanDo(), new Chats());

It allows for descriptive but flexible method of a protocol implementation describing what is possible and what is known. We may be able to then shorthand this to simple "TruthBuilder", but at least the underlying functionality can be described in great detail and extended if a game comes along that has some truly unique functionality.

phogue pushed a commit that referenced this issue Dec 31, 2013
phogue pushed a commit that referenced this issue Dec 31, 2013
phogue pushed a commit that referenced this issue Dec 31, 2013
This will be populated by each game protocol
phogue pushed a commit that referenced this issue Dec 31, 2013
I might just copy this over to a few other namespaces..
phogue pushed a commit that referenced this issue Dec 31, 2013
phogue pushed a commit that referenced this issue Dec 31, 2013
@phogue phogue closed this as completed in e7fb5c3 Dec 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant