pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata prefab_obj_data.cxx,NON


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata prefab_obj_data.cxx,NONE,1.1 prefab_obj_data.hxx,NONE,1.1
Date: 15 Sep 2002 15:30:23 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/worldobjsdata
In directory dark:/tmp/cvs-serv10202/worldobjsdata

Added Files:
        prefab_obj_data.cxx prefab_obj_data.hxx 
Log Message:
some prefab framework

--- NEW FILE: prefab_obj_data.cxx ---
//  $Id: prefab_obj_data.cxx,v 1.1 2002/09/15 15:30:21 grumbel Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#include "prefab_obj_data.hxx"

PrefabData::PrefabData (xmlDocPtr doc, xmlNodePtr cur)
{
}

WorldObj*
PrefabData::create_WorldObj ()
{
  return data->create_EditorObj ();
}

EditorObjLst
create_EditorObj ()
{
  return data->create_EditorObj ();
}

/* EOF */

--- NEW FILE: prefab_obj_data.hxx ---
//  $Id: prefab_obj_data.hxx,v 1.1 2002/09/15 15:30:21 grumbel Exp $
// 
//  Pingus - A free Lemmings clone
//  Copyright (C) 2000 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
// 
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PREFAB_DATA_HXX
#define HEADER_PREFAB_DATA_HXX

#include "libxmlfwd.hxx"
#include "worldobj_data.hxx"

namespace WorldObjsData {

/** A prefab is a group of WorldObj's which form a bigger object, like
    a generic entrance with background and foreground layer. The
    PrefabObjData itself is just an WorldObjData, which gives access
    to the underlying WorldObjDatas.

    Node that a prefab is saved as 'link' in the xml file, the
    worldobj data itself is not saved, entry will look like:

    <prefab type="stoney-entrance"/>
*/
class PrefabObjData : public WorldObjData
{
public:
  /** The position of the prefab */
  CL_Vector pos;

  /** The uniq identifer of this prefab */
  std::string uid;
  
  /** A pointer to the prefab (just for caching, this is not real data
      of this object, since it can be consturcted from the name) */
  Prefab* data;

  PrefabData (xmlDocPtr doc, xmlNodePtr cur);

  /** The PrefabData is flattened to a WorldObjGroup, the World
      doesn't need to keep track of prefabs */
  WorldObj* create_WorldObj ();
  
  /** Create a EditorObjs::PrefabObj from the prefab data */
  EditorObjLst create_EditorObj ();

private:
  PrefabData (const PrefabData&);
  PrefabData operator= (const PrefabData&);
};

} // namespace WorldObjsData

#endif

/* EOF */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]