GithubHelp home page GithubHelp logo

axage's Introduction

axage's People

Contributors

ennowulff avatar jung-thomas avatar kjetil-kilhavn avatar larshp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

axage's Issues

Type "IF_OO_ADT_CLASSRUN_OUT" is unknown.

CLASS zcl_axage_demo1 DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .

  PUBLIC SECTION.
    INTERFACES if_oo_adt_classrun.
    METHODS constructor.
  PROTECTED SECTION.
  PRIVATE SECTION.
    DATA bill_developer TYPE REF TO zcl_axage_actor.
    DATA mark_consultant TYPE REF TO zcl_axage_actor.
    DATA engine TYPE REF TO zcl_axage_engine.
    METHODS interprete
      IMPORTING
        command TYPE clike
        out     TYPE REF TO if_oo_adt_classrun_out. "<===
ENDCLASS.

@jung-thomas is it only available in a cloud system?

use json file to create adventures

I asked ChatGPT to create a json file for the following adventure:

_i have created a text adventure engine where rooms, things and actorss can interact with each other. a room can have things and actors and exits to the north, east, south and west. an actor can hold things and give it to the protagonist. a thing can be a treasure or a tool to open things (e.g. a knife, an axe or a stone) or hide a treasure (e.g. a box or or a chest). a treasure can be something like gold, wisdom, a ring, money, a statue or something similar.
create a json file which describes the following situation or task:

a poor knight needs to find a dragon in a dungeon, fight him and bring the golden ring, the dragon protects to a maiden_

{
  "rooms": [
    {
      "id": 1,
      "name": "Entrance Hall",
      "description": "You are standing in the entrance hall of the dungeon. The air is thick with the smell of damp stone and mildew. The walls are rough-hewn and the floor is covered in dust and debris.",
      "exits": [
        {
          "direction": "north",
          "room_id": 2
        }
      ],
      "things": [],
      "actors": []
    },
    {
      "id": 2,
      "name": "Dragon's Lair",
      "description": "You have entered the dragon's lair. The room is filled with the heat of the dragon's breath, and the walls are scorched black. In the center of the room, the dragon is sleeping on a pile of treasure.",
      "exits": [],
      "things": [
        {
          "id": 1,
          "name": "Golden Ring",
          "description": "A shiny golden ring, set with a large gemstone.",
          "treasure": true,
          "hidden": false
        }
      ],
      "actors": [
        {
          "id": 1,
          "name": "Dragon",
          "description": "A fearsome dragon, with scales as black as coal and eyes that gleam like diamonds. It is fast asleep on a pile of treasure.",
          "holdable_things": [],
          "gives": {
            "thing_id": 1,
            "to_actor_id": 2
          }
        },
        {
          "id": 2,
          "name": "Poor Knight",
          "description": "A ragged and tired-looking knight, armed only with a rusty sword and shield.",
          "holdable_things": [
            {
              "id": 2,
              "name": "Rusty Sword",
              "description": "An old and worn sword, with a rusty blade and a frayed hilt.",
              "treasure": false,
              "hidden": false
            },
            {
              "id": 3,
              "name": "Shield",
              "description": "A battered and dented shield, made of wood and metal.",
              "treasure": false,
              "hidden": false
            }
          ],
          "gives": {
            "thing_id": 1,
            "to_actor_id": 3
          }
        },
        {
          "id": 3,
          "name": "Maiden",
          "description": "A beautiful maiden, with long golden hair and a kind face. She is waiting for you outside the dungeon.",
          "holdable_things": [],
          "gives": {}
        }
      ]
    }
  ]
}

In this example, there are two rooms: the entrance hall and the dragon's lair. The dragon's lair contains the golden ring that the poor knight needs to retrieve. The dragon is sleeping on a pile of treasure and must be fought in order to obtain the ring. The poor knight has a rusty sword and shield to use in the fight. Once the poor knight has the golden ring, they must bring it to the maiden waiting outside the dungeon.

Example of Axage with ABAP2UI5

Using the new version in the Pull Request (that has ABAP Cloud Class based approach and serializable instances), I've created a stateless, UI5 version of the of the game interface using the other open-source project ABAP2UI5. I didn't want to do a pull request directly here so as not to introduce a direct, hard dependency to ABAP2UI5.

https://github.com/jung-thomas/axage_example

What the UI looks like. Basic but workable:
image

invalid move is not caught and leads to a dump

Testing @jung-thomas axage_example on HANA1909 ( shhh, don't tell SAP ;) )
axage and abap2ui5 are up to date.

Sequence:
N, execute
E, execute

dump in ZCL_AXAGE_ENGINE, method CMD_LOOK
player->location is initial
and this fails:
IF player->location->things

This may or may not have something to do with the fact that N was not an allowable exit in the first move ;)
image

At the first step, in method INTERPRETE, this comparison fails:
IF player->location->north = zcl_axage_room=>no_exit.
During initialization of "entrance", N is correctly marked "no exit" but the objects are different:
image

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.