Coder Social home page Coder Social logo

Comments (1)

phogue avatar phogue commented on July 30, 2024

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.

from potato.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.