//===========================================================================// // File: Command.cpp // //---------------------------------------------------------------------------// // Date Who Modification // // -------- --- ---------------------------------------------------------- // // 12/15/97 DPB Created this kick ass file // //---------------------------------------------------------------------------// // Copyright (C) 1997, Virtual World Entertainment, Inc. // // All Rights reserved worldwide // // This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL // //===========================================================================// #include "stdafx.h" #include "MW4GameEd.h" #include "Command.h" #include "Selection.h" Command* Current_Command = NULL; extern CMW4GameEdApp theApp; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Command::Command(): Plug(Plug::DefaultData), selectedEntities(NULL) { CSelectionNode *selection_node; CSelectionNode *command_node; ChainIteratorOf iterator(&CSelectionList::Instance->selectionList); iterator.First(); while((selection_node = iterator.ReadAndNext()) != NULL) { Check_Pointer(selection_node); command_node = new CSelectionNode(selection_node->selectedEntity); Register_Object(command_node); selectedEntities.Add(command_node); } theApp.m_MissionSaved = false; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Command::~Command() { } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void Command::Execute() { //Nothing here. Need to override on higher layer } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void Command::Undo() { //Nothing here. Need to override on higher layer } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void Command::Delete() { CSelectionNode *selection_node; if (!selectedEntities.IsEmpty()) { ChainIteratorOf iterator(&selectedEntities); iterator.First(); while((selection_node = iterator.ReadAndNext()) != NULL) { Check_Object(selection_node->selectedEntity); selection_node->selectedEntity->SentenceToDeathRow(); } } } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // void Command::TestInstance() { }