HIGHAREA.CPP
上传用户:abcdshs
上传日期:2007-01-07
资源大小:1858k
文件大小:1k
源码类别:

游戏

开发平台:

Visual C++

  1. // (C) Copyright 1996 by Anthony J. Carin.  All Rights Reserved.
  2. #include "stdafx.h"
  3. #include "higharea.h"
  4. higharea::higharea(surfs& area)
  5. {
  6.     *((surfs*)this) = area;
  7.     prev = 0;
  8.     next = Game->HighAreas()->m_First;
  9.     if (Game->HighAreas()->m_First)
  10.         Game->HighAreas()->m_First->prev = this;
  11.     Game->HighAreas()->m_First = this;
  12. }
  13. higharea::~higharea()
  14. {
  15.     if (prev)
  16.     {
  17.         prev->next = next;
  18.         if (next)
  19.             next->prev = prev;
  20.         if (Game->HighAreas()->m_Curr == this)
  21.             Game->HighAreas()->m_Curr = Game->HighAreas()->m_First;
  22.     }
  23.     else
  24.     {
  25.         Game->HighAreas()->m_First = next;
  26.         if (Game->HighAreas()->m_Curr == this)
  27.             Game->HighAreas()->m_Curr = Game->HighAreas()->m_First;
  28.         if (next)
  29.             next->prev = 0;
  30.     }
  31. }
  32. void highlist::Purge()
  33. {
  34.     higharea *TmpFirst = m_First;
  35.     higharea *TmpCurr;
  36.     while (TmpFirst)
  37.     {
  38.         TmpCurr = TmpFirst;
  39.         TmpFirst = TmpFirst->next;
  40.         delete m_Curr;
  41.     }
  42.     m_First = m_Curr = 0;
  43. }