-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopycell.cpp
More file actions
44 lines (37 loc) · 1.05 KB
/
Copy pathcopycell.cpp
File metadata and controls
44 lines (37 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "copycell.h"
copycell::copycell(ApplicationManager* pApp) : Action(pApp)
{
}
void copycell::ReadActionParameters()
{
Copygrid = pManager->GetGrid();
Output* pOut = Copygrid->GetOutput();
Input* pIn = Copygrid->GetInput();
pOut->PrintMessage("click on cell to copy");
Copycellposition = pIn->GetCellClicked();
pOut->ClearStatusBar();
}
void copycell::Execute()
{
ReadActionParameters();
Clipboard = Copygrid->Getobjectfromcelllist(Copycellposition);//set object in clipboard
if (!Clipboard)//cell is empty
{
Copygrid->PrintErrorMessage("error : no object to copy ! click to continue..");
}
else if (dynamic_cast<Flag*>(Clipboard)) //cell has flag can't be copying
{
Copygrid->PrintErrorMessage("error : flag can't be copy ! click to continue..");
}
else if (dynamic_cast<Antenna*>(Clipboard))//cell has antenna can't be copying
{
Copygrid->PrintErrorMessage("error : antenna can't be copy ! click to continue..");
}
else
{
Copygrid->SetClipboard(Clipboard);
}
}
copycell::~copycell()
{
}