Sprache Deutsch Language English

Script Dokumentation LS 2015 - PloughLimitToFieldEvent (Patch 1.3)

Script Dokumentation Übersicht

scripts/vehicles/specializations/PloughLimitToFieldEvent.lua

Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de
1-- Copyright (C) GIANTS Software GmbH, Confidential, All Rights Reserved.
2
3PloughLimitToFieldEvent = {};
4PloughLimitToFieldEvent_mt = Class(PloughLimitToFieldEvent, Event);
5
6InitStaticEventClass(PloughLimitToFieldEvent, "PloughLimitToFieldEvent", EventIds.EVENT_PLOUGH_LIMIT_TO_FIELD);
7
8function PloughLimitToFieldEvent:emptyNew()
9 local self = Event:new(PloughLimitToFieldEvent_mt);
10 return self;
11end;
12
13function PloughLimitToFieldEvent:new(object, ploughLimitToField)
14 local self = PloughLimitToFieldEvent:emptyNew()
15 self.object = object;
16 self.ploughLimitToField = ploughLimitToField;
17 return self;
18end;
19
20function PloughLimitToFieldEvent:readStream(streamId, connection)
21 local id = streamReadInt32(streamId);
22 self.ploughLimitToField = streamReadBool(streamId);
23 self.object = networkGetObject(id);
24 self:run(connection);
25end;
26
27function PloughLimitToFieldEvent:writeStream(streamId, connection)
28 streamWriteInt32(streamId, networkGetObjectId(self.object));
29 streamWriteBool(streamId, self.ploughLimitToField);
30end;
31
32function PloughLimitToFieldEvent:run(connection)
33 self.object:setPloughLimitToField(self.ploughLimitToField, true);
34 if not connection:getIsServer() then
35 g_server:broadcastEvent(PloughLimitToFieldEvent:new(self.object, self.ploughLimitToField), nil, connection, self.object);
36 end;
37end;
Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de
Script Dokumentation Übersicht