align.h

Go to the documentation of this file.
00001 /*      SCCS Id: @(#)align.h    3.4     1991/12/29      */
00002 /* Copyright (c) Mike Stephenson, Izchak Miller  1991.            */
00003 /* NetHack may be freely redistributed.  See license for details. */
00004 
00005 #ifndef ALIGN_H
00006 #define ALIGN_H
00007 
00008 typedef schar   aligntyp;       /* basic alignment type */
00009 
00010 typedef struct  align {         /* alignment & record */
00011         aligntyp        type;
00012         int             record;
00013 } align;
00014 
00015 /* bounds for "record" -- respect initial alignments of 10 */
00016 #define ALIGNLIM        (10L + (moves/200L))
00017 
00018 #define A_NONE        (-128)    /* the value range of type */
00019 
00020 #define A_CHAOTIC       (-1)
00021 #define A_NEUTRAL        0
00022 #define A_LAWFUL         1
00023 
00024 #define A_COALIGNED      1
00025 #define A_OPALIGNED     (-1)
00026 
00027 #define AM_NONE          0
00028 #define AM_CHAOTIC       1
00029 #define AM_NEUTRAL       2
00030 #define AM_LAWFUL        4
00031 
00032 #define AM_MASK          7
00033 
00034 #define AM_SPLEV_CO      3
00035 #define AM_SPLEV_NONCO   7
00036 
00037 #define Amask2align(x)  ((aligntyp) ((!(x)) ? A_NONE \
00038                          : ((x) == AM_LAWFUL) ? A_LAWFUL : ((int)x) - 2))
00039 #define Align2amask(x)  (((x) == A_NONE) ? AM_NONE \
00040                          : ((x) == A_LAWFUL) ? AM_LAWFUL : (x) + 2)
00041 
00042 #endif /* ALIGN_H */