hedgewars/uTriggers.pas
author unc0rr
Sun, 09 Sep 2007 14:53:28 +0000
changeset 589 f382c41f658a
child 593 1f5e66379a43
permissions -rw-r--r--
Start implementing triggers in engine
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
589
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
     1
(*
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
     2
 * Hedgewars, a worms-like game
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
     3
 * Copyright (c) 2007 Andrey Korotaev <unC0Rr@gmail.com>
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
     4
 *
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
     8
 *
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    12
 * GNU General Public License for more details.
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    13
 *
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    17
 *)
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    18
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    19
unit uTriggers;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    20
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    21
interface
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    22
uses SDLh, uConsts;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    23
{$INCLUDE options.inc}
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    24
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    25
procedure AddTrigger(id: Longword);
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    26
procedure DoTrigger(id: Longword);
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    27
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    28
implementation
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    29
uses uGears;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    30
type PTrigger = ^TTrigger;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    31
     TTrigger = record
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    32
                id: Longword;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    33
                Next: PTrigger;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    34
                end;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    35
var TriggerList: PTrigger = nil;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    36
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    37
procedure AddTrigger(id: Longword);
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    38
var tmp: PTrigger;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    39
begin
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    40
new(tmp);
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    41
FillChar(tmp^, sizeof(TGear), 0);
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    42
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    43
tmp^.id:= id;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    44
if TriggerList <> nil then tmp^.Next:= TriggerList;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    45
TriggerList:= tmp
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    46
end;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    47
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    48
procedure DoTrigger(id: Longword);
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    49
begin
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    50
end;
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    51
f382c41f658a Start implementing triggers in engine
unc0rr
parents:
diff changeset
    52
end.