2021-06-22 23:58:19 +08:00
|
|
|
package com.gtnewhorizon.structurelib.structure;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implement this and use {@link StructureUtility#withContext(IStructureElement)} in case you need to record some
|
|
|
|
|
* temporary states that don't need to live in your main context, which would usually live for the whole lifetime of the
|
2022-09-06 16:34:46 +08:00
|
|
|
* structure than just during structure check. Usually just save some few bytes, but becomes non-trivial if you need to
|
2021-06-22 23:58:19 +08:00
|
|
|
* record too much stuff.
|
2022-07-08 17:14:18 +08:00
|
|
|
* <p>
|
2021-06-22 23:58:19 +08:00
|
|
|
* You will have to reset the context yourself though. The API can't guess when the old context becomes invalid.
|
2022-07-08 17:14:18 +08:00
|
|
|
*
|
2021-06-22 23:58:19 +08:00
|
|
|
* @param <CTX> the temporary state context
|
|
|
|
|
*/
|
|
|
|
|
public interface IWithExtendedContext<CTX> {
|
2023-01-30 12:52:27 +00:00
|
|
|
|
2021-06-22 23:58:19 +08:00
|
|
|
CTX getCurrentContext();
|
|
|
|
|
}
|