dstmodders / mod-sdk

[In development] Mod SDK for the game Don't Starve Together.
https://docs.dstmodders.com/sdk/
MIT License
5 stars 1 forks source link

Add SDK.Player.Action #6

Open victorpopkov opened 2 years ago

victorpopkov commented 2 years ago

Is your feature request related to a problem? Please describe.

We should consider adding a new SDK.Player.Action module to handle everything related to different player actions. For example, see https://github.com/dstmodders/dst-mod-keep-following/pull/8. It would be nice to have SDK.Player.Action.UseItem() at very least and let SDK respect both client and server.

Describe the solution you'd like

Add SDK.Player.Action similar to SDK.Player.Attribute. Respectively, SDK.Remote.Player should be extended. I would also consider adding 4th level submodules support and split SDK.Remote.Player further:

SDK.Remote.Player.Action
SDK.Remote.Player.Attribute

The existing SDK.Player.WalkToPoint() and SDK.RPC.WalkToPoint() should be moved into SDK.Player.Action and SDK.Remote.Player.Action respectively.

Describe alternatives you've considered

We could leave SDK.RPC as is and not extend SDK.Remote.Player. Another consideration is that we could move all player-related remote functionality:

SDK.Remote.Player.Action => SDK.Player.Remote.Action
SDK.Remote.Player.Attribute => SDK.Player.Remote.Attribute

Additional context

Progress

  1. [ ] Add SDK.Player.Action
  2. [ ] Move and rename SDK.Remote.Player to SDK.Player.Remote
  3. [ ] Split SDK.Player.Remote into submodules:
    1. [ ] SDK.Player.Remote.Action
    2. [ ] SDK.Player.Remote.Attribute
  4. [ ] Implement SDK.Player.Remote.Action functions:
    1. [ ] Hide()
    2. [ ] UseItem()
    3. [ ] UseEquippedHeadItem()
    4. [ ] UseEquippedBodyItem()
    5. [ ] WalkToPoint()
  5. [ ] Implement SDK.Player.Action functions:
    1. [ ] Hide()
    2. [ ] UseItem()
    3. [ ] UseEquippedHeadItem()
    4. [ ] UseEquippedBodyItem()
    5. [ ] WalkToPoint()
  6. [ ] Write tests