Exemplo n.º 1
0
        public static ushort PtTransDoor(BaseTile tile)
        {
            ushort result;

            if (!tile.HasState(BaseTile.TS_SEEN))
            {
                int @base = tile.ForeBase;
                int @var  = tile.ForeVar;

                int p = (@base);
                int res;

                switch (p)
                {
                case PlaceID.pid_DoorN_Closed:
                    res = PlaceID.pid_DoorN;
                    break;

                case PlaceID.pid_DoorS_Closed:
                    res = PlaceID.pid_DoorS;
                    break;

                case PlaceID.pid_DoorW_Closed:
                    res = PlaceID.pid_DoorW;
                    break;

                case PlaceID.pid_DoorE_Closed:
                    res = PlaceID.pid_DoorE;
                    break;

                default:
                    res = p;
                    break;
                }

                result = BaseTile.GetVarID((byte)res, (byte)@var);
            }
            else
            {
                result = tile.Foreground;
            }

            return(result);
        }