private static TCODColor GetRarityColour(RCell cell, TCODColor defaultColour) { if (cell.Is(RCell.Uncommon)) { return(TCODColor.lightGreen); } if (cell.Is(RCell.Rare)) { return(TCODColor.lighterBlue); } if (cell.Is(RCell.Epic)) { return(TCODColor.lightMagenta); } if (cell.Is(RCell.Legendary)) { return(TCODColor.lightYellow); } if (cell.Is(RCell.Artifact)) { return(TCODColor.lightRed); } return(defaultColour); }
public static Stat GetStatBonus(this RCell cell) { // lemme just take a moment to tell you C# is a PITA to work with flags... var cellAsLong = (ulong)cell; const int offset = (int)RCell.StatBonusOffset; return((Stat)(cellAsLong >> offset)); }
public static RCell InsertCombatBonus(this RCell cell, ulong combatBonus) { var cellAsLong = (ulong)cell; const int offset = (int)RCell.StatBonusOffset; var shift = combatBonus << offset; var result = cellAsLong | shift; return((RCell)result); }
public static bool IsTransparent(this RCell cell) { return(!cell.Is(RCell.LightBlocking) || cell.Is(RCell.Transparent)); }
public static bool IsWalkable(this RCell cell) { return(cell.Is(RCell.Walkable)); }
public static bool Is(this RCell cell, RCell attribute) { return((cell & attribute) > 0); }