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

Add publicly exposed engine's API for C FFI (including C header) #18

Closed
lunacys opened this issue May 15, 2024 · 1 comment
Closed

Add publicly exposed engine's API for C FFI (including C header) #18

lunacys opened this issue May 15, 2024 · 1 comment
Labels
engine Engine-related tasks feature A new feature

Comments

@lunacys
Copy link
Collaborator

lunacys commented May 15, 2024

We plan to write a fully featured client in C#, so we need to create a dynamically linked library with engine's API.
An example is available here.

The API should be in a separate crate named c-api.

Maybe #10 should be done first so the API is asynchronous.

API:

  • Game Settings:
    • Gravity
    • Board
    • Attack
    • Wall Kick Mode
  • Time Manager
    • new()
    • update(delta_seconds)
    • reset()
    • enable()
    • disable()
  • Cell Holder:
    • get_occupied_cell_count()
    • clear()
    • get_row(y)
    • set_row(y, row)
    • move_down(from_y, should_update_cell_count)
    • move_up(should_update_cell_count)
    • get_cell_at(x, y)
    • set_cell_at(x, y, cell)
  • Piece (current piece):
    • get_type()
    • get_cell_type()
    • get_offset_type()
    • get_bounds()
    • get_x() and set_x()
    • get_y() and set_y()
    • rotation_state()
  • Piece Manager:
  • Piece Queue:
  • Board:
    • new(game_settings, wall_kick_data, seed)
    • update(time_mgr)
    • move_left(delta)
    • move_right(delta)
    • rotate(direction)
    • try_hold_piece()
    • get_hold_piece()
    • exec_action(action)
    • hard_drop()
    • soft_drop(delta)
    • push_garbage(amount, messiness)
    • attack(damage)
    • find_nearest_y()
    • reset()
    • enable()
    • disable()
    • get_cell_holder()
    • get_piece_manager()
    • get_current_piece()
    • get_piece_queue()
    • get_layout()
    • get_nearest_y()
    • get_piece_points()
    • get_garbage_queue()
    • get_stats()
    • get_settings()
    • is_dead()
@lunacys lunacys added feature A new feature engine Engine-related tasks labels May 15, 2024
@lunacys
Copy link
Collaborator Author

lunacys commented Jun 13, 2024

No longer needed as the client will be rewritten in Rust+Bevy

@lunacys lunacys closed this as not planned Won't fix, can't repro, duplicate, stale Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine Engine-related tasks feature A new feature
Projects
None yet
Development

No branches or pull requests

1 participant