diff --git a/source/simulation2/docs/CCmpExample.cpp b/source/simulation2/docs/CCmpExample.cpp index 16d87f0883..062817c829 100644 --- a/source/simulation2/docs/CCmpExample.cpp +++ b/source/simulation2/docs/CCmpExample.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * ...the usual copyright header... */ @@ -26,12 +26,12 @@ public: return ""; } - virtual void Init(const CSimContext& context, const CParamNode& paramNode) + virtual void Init(const CParamNode& paramNode) { // ... } - virtual void Deinit(const CSimContext& context) + virtual void Deinit() { // ... } @@ -41,12 +41,12 @@ public: // ... } - virtual void Deserialize(const CSimContext& context, const CParamNode& paramNode, IDeserializer& deserialize) + virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) { // ... } - virtual void HandleMessage(const CSimContext& context, const CMessage& msg, bool UNUSED(global)) + virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) { // ... } diff --git a/source/simulation2/docs/ICmpExample.cpp b/source/simulation2/docs/ICmpExample.cpp index 7866b9ad40..fad9fb9fa9 100644 --- a/source/simulation2/docs/ICmpExample.cpp +++ b/source/simulation2/docs/ICmpExample.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * ...the usual copyright header... */ diff --git a/source/simulation2/docs/ICmpExample.h b/source/simulation2/docs/ICmpExample.h index d83880ed90..48af51892f 100644 --- a/source/simulation2/docs/ICmpExample.h +++ b/source/simulation2/docs/ICmpExample.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify diff --git a/source/simulation2/docs/SimulationDocs.h b/source/simulation2/docs/SimulationDocs.h index b5056d243d..c8b1de5556 100644 --- a/source/simulation2/docs/SimulationDocs.h +++ b/source/simulation2/docs/SimulationDocs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -199,7 +199,7 @@ to hear about all MT_Destroy messages.) Then you need to respond to the messages in @c HandleMessage: @code -virtual void HandleMessage(const CSimContext& context, const CMessage& msg, bool UNUSED(global)) +virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) { switch (msg.GetType()) { @@ -222,17 +222,17 @@ Component type instances go through one of two lifecycles: @code CCmpExample(); -Init(context, paramNode); +Init(paramNode); // any sequence of HandleMessage and Serialize and interface methods -Deinit(context); +Deinit(); ~CCmpExample(); @endcode @code CCmpExample(); -Deserialize(context, paramNode, deserialize); +Deserialize(paramNode, deserialize); // any sequence of HandleMessage and Serialize and interface methods -Deinit(context); +Deinit(); ~CCmpExample(); @endcode @@ -241,9 +241,6 @@ so they must not rely on other entities or components already existing; @em exce created before anything else and therefore may be used, and that the components for a single entity will be processed in the order determined by TypeList.h. -The same @c context object will be used in all these calls. -The context can also be accessed with IComponent::GetSimContext. - In a typical component: - The constructor should do very little, other than perhaps initialising some member variables - @@ -526,8 +523,8 @@ CComponentManager::BroadcastMessage to send to all entities. @code CMessageExample msg(10, 20); -context.GetComponentManager().PostMessage(ent, msg); -context.GetComponentManager().BroadcastMessage(msg); +GetSimContext().GetComponentManager().PostMessage(ent, msg); +GetSimContext().GetComponentManager().BroadcastMessage(msg); @endcode From JS, use @ref CComponentManager::Script_PostMessage "Engine.PostMessage" and