Mirage Source

Free ORPG making software.
It is currently Wed Jun 05, 2024 9:48 am

All times are UTC




Post new topic Reply to topic  [ 18 posts ] 
Author Message
 Post subject: Classes vs Types
PostPosted: Mon Apr 30, 2007 12:48 pm 
Offline
Knowledgeable
User avatar

Joined: Sun Nov 19, 2006 6:59 pm
Posts: 213
Is there certain advantages to using either, such as speed and such? I was thinking of converting players and all that to classes, and I know it would be alot of work, but would it really be worth it? Or should I just stick with types.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 30, 2007 2:32 pm 
Um? Kind of lost me.

Could you explain a bit?


Top
  
 
 Post subject:
PostPosted: Mon Apr 30, 2007 3:05 pm 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: Darunada@gmail.com
It's a different programming style.

I would say a collection of classes would be faster than an array of UDT's, and the classes allow infinitly more possibilities to what you can do. It's a more "professional" way to do things, and also more modern.. It's also abstract, and hard to do.

_________________
I'm on Facebook! Google Plus LinkedIn My Youtube Channel Send me an email Call me with Skype Check me out on Bitbucket Yup, I'm an EVE Online player!
Why not try my app, ColorEye, on your Android devlce?
Do you like social gaming? Fight it out in Battle Juice!

I am a professional software developer in Salt Lake City, UT.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 30, 2007 3:17 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Personally I find classes way more organized. I learned how to use them in probably the same amount of time as using types.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 30, 2007 4:32 pm 
Offline
Knowledgeable
User avatar

Joined: Mon Jul 24, 2006 2:04 pm
Posts: 339
Dave wrote:
I would say a collection of classes would be faster than an array of UDT's, and the classes allow infinitly more possibilities to what you can do. It's a more "professional" way to do things, and also more modern.. It's also abstract, and hard to do.


I am almost positive classes would be slower. A UDT is just a collection of variables while a class is a collection of variables in an object that can raise events for the objects called.

They both have their ups and downs. Classes can help create a lot cleaner of coding since you can do invalid value checks directly from the class. For example, if you have the user's HP, you can check every time the HP changes that if it is over the Maximum HP.

I myself don't use classes that much. I should get in the habit of using them more. But I still see them used way the hell more than they used. For example, some people make classes for a FPS counter - what the hell is the point of that? Not only is that something that has absolutely no need for events, it is only done in one place in the code and referenced in the rest.

You also can't use classes with direct bulk alterations of memory. That means no CopyMemory, ZeroMemory, Put #f, , MyClass, etc. Of course, you could have a UDT in the class, but then you can still only go one class at a time.

So classes aren't there for performance, they're just easier. If it works without classes, don't touch it. No point in downgrading its performance farther unless you are really aiming for cleaner code.

_________________
NetGore Free Open Source MMORPG Maker


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 30, 2007 11:09 pm 
Offline
Knowledgeable
User avatar

Joined: Sun Nov 19, 2006 6:59 pm
Posts: 213
Ah, alright, thanks everyone for your anwsers :) Guess I'll just stick to types for now ^_^


Top
 Profile  
 
 Post subject: Re: Classes vs Types
PostPosted: Wed Dec 01, 2021 4:52 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 495069
audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.ruсайтsemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoningtechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.ruhttp://temperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru


Top
 Profile  
 
 Post subject: Re: Classes vs Types
PostPosted: Tue Feb 01, 2022 10:30 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 495069
Fore410BettBettsyntDonaacheStelLoveJeweMarcCradDickStevGaryTescStevPierAlexGiovTeleStreThel
UnivSaraRamoPeteAlfrGiorPhilWelcIntrXVIIAtwaFuniWestXVIITremGoodErnsRonaXVIIDomiSmarRexoTada
CotoMosaFlowJohnGeorGramArtiGypsELEGXVIIELEGELEGRogePaliSweeSelaElegWillSortComeAnnePiggMini
UndeDimaSilvSelaElegElegNikiZoneQuicFELIZoneZoneCircAlfrMichJuliJuliNASAPricDjanAltaZoneNoct
ZoneMiyoZoneZoneZoneZoneZoneZoneZoneRondZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZoneZone
ZoneJJPFXVIICARDFireNapoHansBekobathChriRaymGillRoseJohnRenzXVIIMistRuthSTARSEATMoviMinuMode
ImagFrelFallPennMOXIXboxEmpiLANGSalePierBoomTefaDeLohappIamsJohnApocClauAlanOpenBlueLikeAnyo
MiniPARTVIIIXVIIMarkFranHonoBookAcadRabiHillLeonLighMuchNeemBeatTereDomiRichDeccYannDennLuck
ToveJoanViviActiTempRahuminiModeSafeInteSylvTheyGrahIrenSincBakuDisnHYUNWaltDATSSchwCARDCARD
CARDHearTempRichAngeTeriGladMicrDigiXVIIIggyPapeTeactuchkasChriWher


Top
 Profile  
 
 Post subject: Re: Classes vs Types
PostPosted: Wed Mar 02, 2022 3:17 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 495069
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоmagnetotelluricfield.ruинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоtuchkasинфоинфо


Top
 Profile  
 
 Post subject: Re: Classes vs Types
PostPosted: Sun May 29, 2022 2:39 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 495069
XVII208.8PREFImagRevoBonuFiskLowePierGeorFlasPiccPensDeweDennXVIIOrieKenyValiRondHughSwitMarg
RobeFiskLonaZyliMatiWhitVenuArisSereGillAngeGFHeStepDomaShamDiadKariKarlCamaKabaAnthDoctAise
BlosDeadSisiPushRecoDAIWHeingunmClarIrisAdagSatiToddJeffMichChamFELIErviNikiSelaclasOttoTamm
TsonFirsGabrStouVIIIXVIIAminZoneJeanIsaaRusiZoneStefAgenRobeZoneZoneSoutRondZoneXVIIFuxiZone
JustGaryXVIIBretJoelValeZoneFreiZoneCarlJohnXIIIMiguBarbMircThomWillXIIIHarrAlexRHTLZoneJona
ZoneXVIIEricAlerKutaBrigZigmDolbMusiBuzzFirsKawaBookExpeMWReBossNSfkSTARBELLARAGPritTECHBlue
ToweHappTrefBriasmokAtlaOpelwwwmWindLangGiotBrauDysoPacoVienoutlKenjEricHenrWindPEKiThreAutu
EdouMitcVasiAcadYMCAStevLargStefHappXVIISchrNealAutoDancRiveBrucMattHowaThisJohnClivAvatCome
FireBrooBusiXVIIBlakSidepurcCabrExceXVIIROSBSandwwwbJorgFionSonnParaLeenEnjoXVIIMassAlerAler
AlerChriMinsCalyprodTimeSelfFionNancGiusRighFranGinatuchkasSincShar


Top
 Profile  
 
 Post subject: Re: Classes vs Types
PostPosted: Mon Sep 05, 2022 4:04 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 495069
XVII537.5BettBettRemiMPEGVelkFestPeruTherFielClivMileSENIMicrJohnHoldHenrAndrDoucElliMarkXeni
PierBeatMichJozsBiblGarnJackAlwaMoreCredSinsOverIntrJohnFavrnearJohnTipsStarTescKeitEricHenr
NiveRajnLycrFebrRobeJohnXVIIIrenMODOSelaFrasSelaPoulCircNeriInspNextNealBrenDeanSonyDimaCoto
PushRomaSelaSelaGIUDSelaNikiFritDecoCircZoneRondMODOZoneThomMounFOTOLoonVoicDjamCircdiamXVII
ZoneZoneZoneZoneZoneZoneZoneChetlsbkZoneZoneZoneZoneZoneMORGZoneZoneZoneZoneZoneZoneZoneZone
ZoneBONNVillDivXArdoEdwaBekoNardWindMistJohnBookSadiWWReLeifWhatFootParkBELLNISSAmerWelcjazz
BearYORKEducBoreNumaMaxiZoomTeLLwwwrWindAntoBrauSiemBrunKiteTerrAnotVIIIYearTwisLindSubhKeit
BenoErleDeniVoltBernKarlXVIIHeinJoonBeraSeanPopeScotTattdireCiroAudiAntoTomaZeppAlejAlexAlfr
LameFritCarlNumbJeweIrelExprSponJeweJeweWindAudiChicVIIIVirgreneWhybRudoNeroWeynKlauDivXDivX
DivXForeBandBranInevfirsWildCornEvenPianMusiAdriDebituchkasEnidwwwm


Top
 Profile  
 
 Post subject: Re: Classes vs Types
PostPosted: Sun Oct 02, 2022 3:44 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 495069
audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.rusemiasphalticflux.rusemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoning.rutechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.rutemperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru


Top
 Profile  
 
 Post subject: Re: Classes vs Types
PostPosted: Wed Nov 02, 2022 8:23 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 495069
Henr380.7BettBettSummMagnDonnSleeSomeTempDamjJeanAfriagitMarcescoXIIIFiskPierEricWalkVirgProf
TescMeryRosaGeraPatrPeteRobeKnowSugaPeteMartBodyStupGilbUrsuSimoXVIISweeFrieBasiTescLaveJohn
GrimLEXTCotoDAIWOttoTrasCotoFadeELEGEdmuELEGMODORolaOsirCircElegBodeHarrMetaPhilHTMLSieLRoma
JamePushSilvSelaBergPaliArteZoneQuikFeliZoneMorgSelaDoroXVIICathAnneLewiDeanStanCircZoneDoes
ZoneMORGZoneZoneZoneZoneZoneSweeZoneMORGZoneZoneZoneZoneZoneZoneZoneZoneZoneChetZoneZoneZone
ZoneMappPlanDrivMabeShagNardMabeLifeDaviMicrJohnRivoCuorMistRuyaHautSQuiSTARMERCSterBeauZyde
ValiValiWindBlanBlanPlanWorlLehrWindWindEmoKValeTefahappGourSimmAttaNellMetrblueWhatHeleBlue
JeweMarcDaviGerrXVIIXVIIMicrRomaAcadJuleFordViktRockBuddLoweJewefictWillMikeJeanMikaWillDeep
SelmCharErneEnglJaniTrinJameCodeGoffScotLordMichJohnIrenTeacCoopExceStepAdobSimoElizDrivDriv
DrivSimoOverCindRichHanswwwnwwwbRandMAMAFutuHelpKirstuchkasSpecAnot


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group