-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCSetChunkPropertyNode.cpp
51 lines (35 loc) · 988 Bytes
/
CSetChunkPropertyNode.cpp
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
45
46
47
48
49
50
51
//
// CSetChunkPropertyNode.cpp
// Forge
//
// Created by Uli Kusterer on 03.04.11.
// Copyright 2011 The Void Software. All rights reserved.
//
#include "CSetChunkPropertyNode.h"
#include "CCodeBlock.h"
namespace Carlson
{
CValueNode* CSetChunkPropertyNode::Copy()
{
CSetChunkPropertyNode * nodeCopy = new CSetChunkPropertyNode( mParseTree, mLineNum );
std::vector<CValueNode*>::const_iterator itty;
for( itty = mParams.begin(); itty != mParams.end(); itty++ )
{
nodeCopy->AddParam( (*itty)->Copy() );
}
return nodeCopy;
}
void CSetChunkPropertyNode::GenerateCode( CCodeBlock* inCodeBlock )
{
std::vector<CValueNode*>::const_iterator itty = mParams.begin();
(*itty)->GenerateCode( inCodeBlock );
itty++;
uint32_t chunkType = (*itty)->GetAsInt();
itty++;
for( ; itty != mParams.end(); itty++ )
{
(*itty)->GenerateCode( inCodeBlock );
}
inCodeBlock->GenerateSetChunkPropertyInstruction( BACK_OF_STACK, chunkType );
}
} // namespace Carlson