SRL Archive - SRL Archives

Players[X].Arrays[X]


marpis

2009-10-02 16:12:45

I think there should be an array of TVariantArray in TUser

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);

Players[0].Name := 'Killerer';
Players[0].Pass := 'Pass123';
Players[0].Arrays[0] := ['illow', 'Oak']; // Trees to cut
Players[0].Arrays[1] := [5, 60]; // [LoadsBeforeSwitch, TotalLoads]
Players[0].Active := True;
end;


{ type TUser;
Description: The User Record. }
type
TUser = record
Name: string; // * User Name
Pass: string; // * User Pass
Pin: string; // * Current Users Pin Number
Nick: string; // * Screen Name for random detection
NickTPA: TPointArray; // * TPA Of Player Name
Level: array[0..24] of Word; // * Levels of all skills.
Active: Boolean; // * Set to True if Ok, False if Lost.
Loc: string; // * User Location
Skill: string; // * User Action to Perform
Worked: Integer; // * Time User has worked
Banked: Integer; // * Number of Banks User has done
Rand: string; // * Current Random
Booleans: array of Boolean; // * For reports, etc.
Integers: array of Integer; // * For reports, etc.
Strings: array of string; // * For reports, etc.
Extendeds: array of Extended; // * For reports, etc.
BoxRewards: TStringArray; // * Partial texts for rewards, place in order of want.
Arrays: array of TVariantArray; // * For all types of arrays
end;

Rich

2009-10-02 18:20:19

I like it…Very much. This should be added, it would save many lines of code, and look more pro I think. :)

Quickmarch

2009-10-02 18:53:23

Good idea! :) Would make things so much simpler as you would just have one Type instead of Strings, Integers, etc.

Nava2

2009-10-02 18:54:31

I'd agree, you meant to say array of TVariantArray, yes?

Edited post to say array of TVariantArray. Also, I think this would remove some of the need for custom records for player arrays. :)

Excellent idea, rep++

EvilChicken!

2009-10-02 19:13:17

Committed, with some other stuff too.

"Place in order of want."
Hah.

Sir R. M8gic1an

2009-10-02 21:07:45

humm. I don't believe you can actually do

Players[x].Arrays[x] := TStringArray, but we'll soon find out i guess.

~RM

senrath

2009-10-02 21:16:02

From: Rasta Magician
humm. I don't believe you can actually do

Players[x].Arrays[x] := TStringArray, but we'll soon find out i guess.

~RM


That won't work, but you can use it like:

Players[x].Arrays[x] := TVariantArray that only contains strings.