HaxeFoundation / HaxeFoundation/HaxeManual

Document Class Shadowing

Open
#541 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
225
Forks
156
Avg merge
5h 16m
Merged PRs (30d)
1

Description

Explanation from the Haxe Discord:

**shadow**
Shadowing classes in haxe, means, overwriting an original source file with a local copy without needing to modify the original copy.

This is useful under situations where you want to test out changes to libraries, or change something to fit your projects needs.

1) Locate the full package of the file you wish to overwrite as an example - flixel/system/frontEnds/SoundFrontEnd.hx
2) Go to your own project and locate your source directory. Create a file called SoundFrontEnd.hx at the exact same destination. So it looks a little like: your_project_root/src/flixel/system/frontEnds/SoundFrontEnd.hx
3) Copy the contents of the original file (or a pr) to the file created within your project
4) You've now overwritten the original source file! Make any changes you wish to this file and it will apply to all SoundFrontEnd references, including inside libraries.

Notes:
it's even possible with a lib, as long as -lib newImplem is later than -lib oldImplem in hxml order

It replaces the entire file, but it is possible to replace specific vars and functions using a macro, if that is actually what you want.

Contributor guide

No contributing guide indexed for this repository

Research direction

Use the issue text as the source for documenting class shadowing, including the SoundFrontEnd.hx path, project src layout, and -lib ordering in hxml. No target manual file or section is named, so first locate the appropriate documentation entry point; done means the workflow and its whole-file replacement behavior are clearly explained.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.