Code Search for Developers
 
 
  

GameStatisticsClasses.pas from Sector-37 at Krugle


Show GameStatisticsClasses.pas syntax highlighted


                    //*******************************//
                    //                               //
                    //Strange Game Statistic Classes //
                    //                               //
//******************//*******************************//*********************//
//                                                                          //
//        This unit is the part of a real time 3d space strategy engine     //
//                      (www.federation.netfirms.com)                       //
//                                                                          //
//**************************************************************************//

{
Author  : Alexander Federyakov aka Da Stranger
Version : 0.001 ;-]
Date    : 22 October '2005
License : You can use this unit ONLY for educational purposes. You cannot use
          more than 10% of its code in your own personal projects. It cannot
          be used for any commercial  products.
Comments: This is the core of a 3d realtime space strategy game engine.
          Much is still to be done...
Requirements:  GLScene
Known Bugs and limitations: none

Contacts:
    Web:    http://www.sector-37.com
    E-mail: datarget@mail.ru
    ICQ:    293-963-070
    Odigo:  8077227
}
unit GameStatisticsClasses;

interface

uses sysutils;

type
TplayerMillitaryStatistics=record
  UnitsKilledNumber:integer;
  UnitsKilledRating:integer;

  UnitsLostNumber:integer;
  UnitsLostRating:integer;

  UnitsProducedNumber:integer;
  UnitsProducedRating:integer;

  PlanetsGainedNumber:integer;
  PlanetsGainedRating:integer;

  ColonizedPlanetsNumber:integer;
  ColonizedPlanetsRating:integer;

  PlanetsLostNumber:integer;
  PlanetsLostRating:integer;

  BuildingsBuiltNumber:integer;
  BuildingsLostNumber:integer;
  BuildingsDestroyedNumber:integer;
end;

TplayerEconomyStatistics=record
  //upgrades

  //researches

  //resources

end;

TplayerDiplomacyStatistics=record
  MadeAlliesNumber:integer;
  MadeEnemiesNumber:integer;
  HelpedAlliesNumber:integer;
  DidntHelpAlliesNumber:integer;

  MissionsDoneNumber:integer;
  MissionsFailedNumber:integer;

end;

TPlayerStatistics=class
  public
//  Player:Tplayer;
  TimeOfDeath:TDateTime;//hm.........

  Millitary:TplayerMillitaryStatistics;
  Economy:TplayerEconomyStatistics;
  Diplomacy:TplayerDiplomacyStatistics;

  MillitaryRatings:array of single;
  EconomyRatings:  array of single;
  DiplomacyRatings:array of single;
  OverRollRatings:array of single;

  procedure UpdateRatings;
  function GetLastMillitaryRating:single;
  function GetLastEconomyRating:single;
  function GetLastDiplomacyRating:single;
  function GetLastOverRollRating:single; //is calculated from the last 3

  destructor Destroy;override;
end;


implementation

{ TPlayerStatistics }

destructor TPlayerStatistics.Destroy;
begin

  inherited;
end;

function TPlayerStatistics.GetLastDiplomacyRating: single;
begin
Result := DiplomacyRatings[length(DiplomacyRatings)-1];
end;

function TPlayerStatistics.GetLastEconomyRating: single;
begin
Result := EconomyRatings[length(EconomyRatings)-1];
end;

function TPlayerStatistics.GetLastMillitaryRating: single;
begin
Result := MillitaryRatings[length(MillitaryRatings)-1];
end;

function TPlayerStatistics.GetLastOverRollRating: single;
begin
Result := OverRollRatings[length(OverRollRatings)-1];
end;

procedure TPlayerStatistics.UpdateRatings;
var
index:integer;
begin
index := length(OverRollRatings);
Setlength(OverRollRatings,index+1);
Setlength(MillitaryRatings,index+1);
Setlength(EconomyRatings,index+1);
Setlength(DiplomacyRatings,index+1);

{ TODO 3 -oDa Stranger -cExtending Capabilities : now calculate the parameters and add them to the arrays }
end;

end.
 




See more files for this project here

Sector-37

Sector-37 (real time 3D cosmic strategy)

Project homepage: http://sourceforge.net/projects/sector37
Programming language(s): Pascal
License: lgpl21

  Campaigns/
    Main/
      map.dsc
      mission1.mis
      mission2.mis
      settings.dsc
    NOT_DECIDED_YET
  Images/
    Cursors/
      Attack.bmp
      Attack.cur
      FollowAndDefend.bmp
      FollowAndDefend.cur
      Menu.bmp
      Menu.cur
      Normal.bmp
      Normal.cur
    Menu/
      Exit-Game.gif
      New-Game.gif
    Misc/
      Console.jpg
  Maps/
    MaterialScripts/
      Sprite.dsc
      clouds.dsc
      default.txt
      planet_day.dsc
      planet_day_origina_minel.dsc
      planet_night.dsc
      red.dsc
      scriptreflective.txt
      super_transparent_planet.dsc
      transparent_planet.dsc
    Meshes/
      asteroid1.3DS
      asteroid2.3DS
      asteroid3.3DS
      asteroid4.3DS
      asteroid5.3DS
      mesh.md3
      mesh_little.md3
      xxx.MD3
    Misc/
      Animations/
        animation.aaf
      Atmospheres/
        atm.dsc
        atm2.dsc
        atm3.dsc
      MovementPaths/
        complicated.dsc
        simple_saved.dsc
      MovementSettings/
        settings.dsc
      Stars/
        xxx.stars
    ObjectScripts/
      AsteroidField.dsc
      AsteroidField2.dsc
      AsteroidField3.dsc
      AsteroidField4.dsc
      Fire_Fx.dsc
      Lensflare1.dsc
      LightSource.dsc
      LightSource_enhanced.dsc
      Light_FX.dsc
      Perlin_FX.dsc
      Real SkyShere.dsc
      SkyShere1.dsc
      SkyShere2.dsc
      Sprite_jupiter.dsc
      Sprite_venus.dsc
      dustCloud1.dsc
      dustCloud2.dsc
      my skybox.dsc
      planet_day_night.dsc
      planet_day_night2.dsc
      planet_mars.dsc
      skybox1.dsc
      stardome1.dsc
      stardome2.dsc
    Textures/
      Meshes/
      Misc/
      Planets/
      SkyBoxes/
      SkySpheres/
      Sprites/
    1.dsc
    2.dsc
    3.dsc
    mission_map.dsc
    xxx.dsc
  Missions/
    Mission1/
  Objects/
    Artifacts/
    Engines/
    Equipment/
    Explosions/
    Race Types/
    Races/
    Shields/
    Unit Classes/
    Units/
    Weapons/
  Profiles/
    Default/
  GLP.nfo
  GameClassAncestors.pas
  GameConstants.pas
  GameEconomyClasses.pas
  GameEngine.pas
  GameSettings.pas
  GameStatisticsClasses.pas
  GameUnitClasses.pas
  MainForm.dfm
  MainForm.pas
  Project_Licence.txt
  Sector37.dpr
  Sector37.ico
  Sector37.res
  Sector37.stat
  Sector37.todo
  _Cleanup.bat
  config.ini
  testing_weapon_position.pas