Skip to content

IsMorphAvailable improvements #640

@Noggog

Description

@Noggog

Analyzers trying to determine if IsMorphAvailable for IMorph objects is clunky and requires bit analysis

public static bool IsMorphAvailable(this IMorphGetter morph, uint index)
{
    var div = (int)index / 8;
    var mod = (byte)(index % 8);
    var data = morph.Data[div];
    return (data & (1 << mod)) != 0;
}

Can probably upgrade it to be an array of bools or something similar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions