Skip to content

Alias call first draft#55

Merged
Perryvw merged 2 commits intomasterfrom
feature/alias-calls
Feb 25, 2018
Merged

Alias call first draft#55
Perryvw merged 2 commits intomasterfrom
feature/alias-calls

Conversation

@Perryvw
Copy link
Copy Markdown
Member

@Perryvw Perryvw commented Feb 25, 2018

To deal with dota client-sided API having different names for the same class. With this in the transpiler you could define aliases in the declarations, e.g.

type C_DOTA_BaseNPC = CDOTA_BaseNPC;

Then an explicit cast would cause the transpiler to use the alias instead of the original class. For example

unit.GetMana()                      ==>   CDOTA_BaseNPC.GetMana(unit)
(<C_DOTA_BaseNpc>unit).GetMana()    ==>   C_DOTA_BaseNPC.GetMana(unit)

Ideally this would automatically be done based on the value of IsServer(), but I currently see no way to do this in declarations while keeping the transpiler as generic as possible.

@Perryvw Perryvw merged commit 5467e7d into master Feb 25, 2018
@lolleko lolleko deleted the feature/alias-calls branch February 26, 2018 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants