Changeset 1184 for cpp/frams/param/param.cpp
- Timestamp:
- 10/17/22 12:28:47 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/param/param.cpp
r1155 r1184 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 0Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2022 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 49 49 return (const char*)memchr((const void*)t, ch, limit - t); 50 50 } 51 52 53 Param2ParamCopy::Param2ParamCopy(ParamInterface& schema, const std::initializer_list<const char*> names) 54 { 55 for (const char* n : names) 56 { 57 int i = schema.findId(n); 58 if (i >= 0) 59 fields.push_back(i); 60 else 61 logPrintf("Param2ParamCopy", "findId", LOG_CRITICAL, "Can't find '%s.%s'", schema.getName(), n); 62 } 63 } 64 65 void Param2ParamCopy::operator()(const ParamInterface& from, ParamInterface& to) 66 { 67 ExtValue tmp; 68 for (int i : fields) 69 { 70 ((ParamInterface&)from).get(i, tmp); 71 to.set(i, tmp); 72 } 73 } 74 51 75 52 76 void ParamInterface::copyFrom(ParamInterface *src)
Note: See TracChangeset
for help on using the changeset viewer.