Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Niflib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Grant Kim
Niflib
Commits
8eeca2c4
Commit
8eeca2c4
authored
14 years ago
by
Amorilia
Browse files
Options
Downloads
Patches
Plain Diff
Type::Create() method (requested by DragoonWraith).
parent
07b54ab9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
change_log.txt
+1
-0
1 addition, 0 deletions
change_log.txt
include/Type.h
+4
-0
4 additions, 0 deletions
include/Type.h
src/Type.cpp
+5
-0
5 additions, 0 deletions
src/Type.cpp
with
10 additions
and
0 deletions
change_log.txt
+
1
−
0
View file @
8eeca2c4
...
...
@@ -640,3 +640,4 @@
* Store block number in NiObject when reading a nif file (requested by DragoonWraith).
* Added cmake build script.
* GetTexture() now returns a TexDesc reference (requested by DragoonWraith).
* Type::Create() method (requested by DragoonWraith).
This diff is collapsed.
Click to expand it.
include/Type.h
+
4
−
0
View file @
8eeca2c4
...
...
@@ -10,6 +10,9 @@ All rights reserved. Please see niflib.h for license. */
using
namespace
std
;
namespace
Niflib
{
// forward declaration
class
NiObject
;
/**
* Run Time Type Information Class
*/
...
...
@@ -23,6 +26,7 @@ public:
NIFLIB_API
bool
IsSameType
(
const
Type
&
compare_to
)
const
;
NIFLIB_API
bool
IsDerivedType
(
const
Type
&
compare_to
)
const
;
NIFLIB_API
bool
operator
<
(
const
Type
&
compare_to
)
const
;
NIFLIB_API
NiObject
*
Create
()
const
;
const
Type
*
base_type
;
private:
string
name
;
...
...
This diff is collapsed.
Click to expand it.
src/Type.cpp
+
5
−
0
View file @
8eeca2c4
...
...
@@ -2,6 +2,7 @@
All rights reserved. Please see niflib.h for license. */
#include
"../include/Type.h"
#include
"../include/ObjectRegistry.h"
using
namespace
Niflib
;
Type
::
Type
(
const
string
&
type_name
,
const
Type
*
par_type
)
:
name
(
type_name
),
base_type
(
par_type
)
{}
...
...
@@ -31,3 +32,7 @@ bool Type::IsDerivedType( const Type & compare_to ) const {
string
Type
::
GetTypeName
()
const
{
return
name
;
}
NiObject
*
Type
::
Create
()
const
{
return
ObjectRegistry
::
CreateObject
(
name
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment