SlideShare a Scribd company logo
1 of 34
Download to read offline
+ sprinkles of




    
    
public void castSpell(Spell spell, bool repeat,
            int timeOutinMs, int rangeInM, bool hitFriendly) {…}

public void castSafeSpell(Spell spell, bool repeat,
            int timeOutinMs, int rangeInM)
        {
            castSpell(spell, repeat, timeOutinMs, range, false);
        }

public void castNeverEndingSpell(Spell spell,
            int rangeInM, bool hitFriendly)
        {
            castSpell(spell, true, -1, range, hitFriendly);
        }
public void castSpell(Spell spell, bool repeat = false,
            int timeOutinMs = -1, int rangeInM = 30,
            bool hitFriendly = false)




Spell frost = new FrostFury();
castSpell(frost);


 Spell frost = new FrostFury();
castSpell(frost, false);
public void castSpell(Spell spell, bool repeat = false,
           int timeOutinMs = -1, int rangeInM = 30,
           bool hitFriendly = false)




Spell frost = new FrostFury();
castSpell(frost, rangeInM: 1000);








    

    
    

    

        List<object> names = new List<string>();
HordeSubject



Orc      Undead      Troll
HordeSubject player = new Orc();


HordeSubject player = new Undead();




List<HordeSubject> raid = new List<Orc>();



           ℤ

    
       ℤ
    

         ∈ℤ
       
       
       
       ∈ℤ

    
        ∀    ∈ℤ
    

    

    
       ∀    ∈ℤ
        ∀    ∈ℤ
    

    

    
       ∀    ∈ℤ
                  ∀   ∈ℤ
    
Orc   HordeSubject
Undead   HordeSubject   OrcShaman   Orc

Orc   HordeSubject
       Orc           HordeSubject

               
Orc   HordeSubject
      Orc                 HordeSubject
List<HordeSubject> raid =
     new List<Orc>();


raid.Add(new Undead());
IEnumerable<HordeSubject> raid =
     new List<Orc>();


                                  out
    public interface IEnumerable<out T>
       {
           IEnumerator<T> GetEnumerator();
       }

    public interface IEnumerator<out T>
       {
           T Current { get; }
           bool MoveNext();
       }
IComparer<HordeSubject> hordeStat =
     GetHordeComparer();
IComparer<Orc> orcStat = hordeStat;



                                       in

    public interface IComparer<in T>
        {
            int Compare(T x, T y);
        }
   
    

   


   

    

    

    

    

    







    
    

    

    

    

    

    

    

    
    

More Related Content

What's hot

Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++mmirfan
 
Fertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureFertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureMike Fogus
 
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterBytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterakaptur
 
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...akaptur
 
Cilk Plus Parallel Reduction
Cilk Plus Parallel ReductionCilk Plus Parallel Reduction
Cilk Plus Parallel ReductionAlbert DeFusco
 
An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to TinkerpopTakahiro Inoue
 
20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会Hiroki Mizuno
 
PFDS 8.4.1
PFDS 8.4.1PFDS 8.4.1
PFDS 8.4.1rf0444
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2goMoriyoshi Koizumi
 
Python opcodes
Python opcodesPython opcodes
Python opcodesalexgolec
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript IntroductionHans Höchtl
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.Mike Fogus
 
bpftrace - Tracing Summit 2018
bpftrace - Tracing Summit 2018bpftrace - Tracing Summit 2018
bpftrace - Tracing Summit 2018AlastairRobertson9
 

What's hot (20)

Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++
 
Fertile Ground: The Roots of Clojure
Fertile Ground: The Roots of ClojureFertile Ground: The Roots of Clojure
Fertile Ground: The Roots of Clojure
 
Vcs16
Vcs16Vcs16
Vcs16
 
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterBytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreter
 
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
 
Cilk Plus Parallel Reduction
Cilk Plus Parallel ReductionCilk Plus Parallel Reduction
Cilk Plus Parallel Reduction
 
Software Exploits
Software ExploitsSoftware Exploits
Software Exploits
 
An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to Tinkerpop
 
20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会
 
Python 5-迴圈-while
Python 5-迴圈-whilePython 5-迴圈-while
Python 5-迴圈-while
 
Snake.c
Snake.cSnake.c
Snake.c
 
Python 4-迴圈-for
Python 4-迴圈-forPython 4-迴圈-for
Python 4-迴圈-for
 
PFDS 8.4.1
PFDS 8.4.1PFDS 8.4.1
PFDS 8.4.1
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
Python opcodes
Python opcodesPython opcodes
Python opcodes
 
JavaScript @ CTK
JavaScript @ CTKJavaScript @ CTK
JavaScript @ CTK
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.
 
bpftrace - Tracing Summit 2018
bpftrace - Tracing Summit 2018bpftrace - Tracing Summit 2018
bpftrace - Tracing Summit 2018
 
Es6 hackathon
Es6 hackathonEs6 hackathon
Es6 hackathon
 

Similar to Casting spells and polymorphism in C

20070329 Java Programing Tips
20070329 Java Programing Tips20070329 Java Programing Tips
20070329 Java Programing TipsShingo Furuyama
 
Java 8 - Nuts and Bold - SFEIR Benelux
Java 8 - Nuts and Bold - SFEIR BeneluxJava 8 - Nuts and Bold - SFEIR Benelux
Java 8 - Nuts and Bold - SFEIR Beneluxyohanbeschi
 
GameOfLife.cs using System; using System.Collections.Generic;.pdf
GameOfLife.cs using System; using System.Collections.Generic;.pdfGameOfLife.cs using System; using System.Collections.Generic;.pdf
GameOfLife.cs using System; using System.Collections.Generic;.pdfaravlitraders2012
 
import java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfimport java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfanwarsadath111
 
LINQ Internals - STLDODN
LINQ Internals - STLDODNLINQ Internals - STLDODN
LINQ Internals - STLDODNKeith Dahlby
 
Kdahlby 200908 Stldodn Linqinternals 090903222505 Phpapp01
Kdahlby 200908 Stldodn Linqinternals 090903222505 Phpapp01Kdahlby 200908 Stldodn Linqinternals 090903222505 Phpapp01
Kdahlby 200908 Stldodn Linqinternals 090903222505 Phpapp01google
 
Apache PIG - User Defined Functions
Apache PIG - User Defined FunctionsApache PIG - User Defined Functions
Apache PIG - User Defined FunctionsChristoph Bauer
 
Java binary subtraction
Java binary subtractionJava binary subtraction
Java binary subtractionCharm Sasi
 
Java, Up to Date Sources
Java, Up to Date SourcesJava, Up to Date Sources
Java, Up to Date Sources輝 子安
 
Are we ready to Go?
Are we ready to Go?Are we ready to Go?
Are we ready to Go?Adam Dudczak
 
5 c control statements looping
5  c control statements looping5  c control statements looping
5 c control statements loopingMomenMostafa
 

Similar to Casting spells and polymorphism in C (13)

20070329 Java Programing Tips
20070329 Java Programing Tips20070329 Java Programing Tips
20070329 Java Programing Tips
 
Java 8 - Nuts and Bold - SFEIR Benelux
Java 8 - Nuts and Bold - SFEIR BeneluxJava 8 - Nuts and Bold - SFEIR Benelux
Java 8 - Nuts and Bold - SFEIR Benelux
 
GameOfLife.cs using System; using System.Collections.Generic;.pdf
GameOfLife.cs using System; using System.Collections.Generic;.pdfGameOfLife.cs using System; using System.Collections.Generic;.pdf
GameOfLife.cs using System; using System.Collections.Generic;.pdf
 
import java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfimport java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdf
 
LINQ Internals - STLDODN
LINQ Internals - STLDODNLINQ Internals - STLDODN
LINQ Internals - STLDODN
 
Kdahlby 200908 Stldodn Linqinternals 090903222505 Phpapp01
Kdahlby 200908 Stldodn Linqinternals 090903222505 Phpapp01Kdahlby 200908 Stldodn Linqinternals 090903222505 Phpapp01
Kdahlby 200908 Stldodn Linqinternals 090903222505 Phpapp01
 
Apache PIG - User Defined Functions
Apache PIG - User Defined FunctionsApache PIG - User Defined Functions
Apache PIG - User Defined Functions
 
The Art of Clean Code
The Art of Clean CodeThe Art of Clean Code
The Art of Clean Code
 
Java binary subtraction
Java binary subtractionJava binary subtraction
Java binary subtraction
 
Java, Up to Date Sources
Java, Up to Date SourcesJava, Up to Date Sources
Java, Up to Date Sources
 
Are we ready to Go?
Are we ready to Go?Are we ready to Go?
Are we ready to Go?
 
PRACTICAL COMPUTING
PRACTICAL COMPUTINGPRACTICAL COMPUTING
PRACTICAL COMPUTING
 
5 c control statements looping
5  c control statements looping5  c control statements looping
5 c control statements looping
 

More from Mustafa Isik

SumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-Simulationsdaten
SumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-SimulationsdatenSumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-Simulationsdaten
SumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-SimulationsdatenMustafa Isik
 
Game Development: The Golden Age of Indie
Game Development: The Golden Age of IndieGame Development: The Golden Age of Indie
Game Development: The Golden Age of IndieMustafa Isik
 
Indie, Indie, Überall: Erfahrungen aus einem Jahr SuperHyperTurbo
Indie, Indie, Überall: Erfahrungen aus einem Jahr SuperHyperTurboIndie, Indie, Überall: Erfahrungen aus einem Jahr SuperHyperTurbo
Indie, Indie, Überall: Erfahrungen aus einem Jahr SuperHyperTurboMustafa Isik
 
Ein Rechner, ein Chip: MOS Technology 6502
Ein Rechner, ein Chip: MOS Technology 6502Ein Rechner, ein Chip: MOS Technology 6502
Ein Rechner, ein Chip: MOS Technology 6502Mustafa Isik
 
Tanning for Open Source Projects - The Google Summer of Code & You
Tanning for Open Source Projects - The Google Summer of Code & YouTanning for Open Source Projects - The Google Summer of Code & You
Tanning for Open Source Projects - The Google Summer of Code & YouMustafa Isik
 
ISTNW Alpha at GTUG Munich
ISTNW Alpha at GTUG MunichISTNW Alpha at GTUG Munich
ISTNW Alpha at GTUG MunichMustafa Isik
 
Anybody can be a great mentor ... maybe
Anybody can be a great mentor ... maybeAnybody can be a great mentor ... maybe
Anybody can be a great mentor ... maybeMustafa Isik
 
Cloud Computing Is Not Cotton Candy ... Or Is It?
Cloud Computing Is Not Cotton Candy ... Or Is It?Cloud Computing Is Not Cotton Candy ... Or Is It?
Cloud Computing Is Not Cotton Candy ... Or Is It?Mustafa Isik
 
Modeling Scenarios with Sequence Diagrams
Modeling Scenarios with Sequence DiagramsModeling Scenarios with Sequence Diagrams
Modeling Scenarios with Sequence DiagramsMustafa Isik
 
Striding towards the Future Multiple Edits at a Time
Striding towards the Future Multiple Edits at a TimeStriding towards the Future Multiple Edits at a Time
Striding towards the Future Multiple Edits at a TimeMustafa Isik
 
Wiring Hacker Synapses - Cola: Real-Time Shared Editing
Wiring Hacker Synapses - Cola: Real-Time Shared EditingWiring Hacker Synapses - Cola: Real-Time Shared Editing
Wiring Hacker Synapses - Cola: Real-Time Shared EditingMustafa Isik
 

More from Mustafa Isik (11)

SumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-Simulationsdaten
SumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-SimulationsdatenSumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-Simulationsdaten
SumoViz v1.0: HTML5-basierte Visualisierung von Fußgänger-Simulationsdaten
 
Game Development: The Golden Age of Indie
Game Development: The Golden Age of IndieGame Development: The Golden Age of Indie
Game Development: The Golden Age of Indie
 
Indie, Indie, Überall: Erfahrungen aus einem Jahr SuperHyperTurbo
Indie, Indie, Überall: Erfahrungen aus einem Jahr SuperHyperTurboIndie, Indie, Überall: Erfahrungen aus einem Jahr SuperHyperTurbo
Indie, Indie, Überall: Erfahrungen aus einem Jahr SuperHyperTurbo
 
Ein Rechner, ein Chip: MOS Technology 6502
Ein Rechner, ein Chip: MOS Technology 6502Ein Rechner, ein Chip: MOS Technology 6502
Ein Rechner, ein Chip: MOS Technology 6502
 
Tanning for Open Source Projects - The Google Summer of Code & You
Tanning for Open Source Projects - The Google Summer of Code & YouTanning for Open Source Projects - The Google Summer of Code & You
Tanning for Open Source Projects - The Google Summer of Code & You
 
ISTNW Alpha at GTUG Munich
ISTNW Alpha at GTUG MunichISTNW Alpha at GTUG Munich
ISTNW Alpha at GTUG Munich
 
Anybody can be a great mentor ... maybe
Anybody can be a great mentor ... maybeAnybody can be a great mentor ... maybe
Anybody can be a great mentor ... maybe
 
Cloud Computing Is Not Cotton Candy ... Or Is It?
Cloud Computing Is Not Cotton Candy ... Or Is It?Cloud Computing Is Not Cotton Candy ... Or Is It?
Cloud Computing Is Not Cotton Candy ... Or Is It?
 
Modeling Scenarios with Sequence Diagrams
Modeling Scenarios with Sequence DiagramsModeling Scenarios with Sequence Diagrams
Modeling Scenarios with Sequence Diagrams
 
Striding towards the Future Multiple Edits at a Time
Striding towards the Future Multiple Edits at a TimeStriding towards the Future Multiple Edits at a Time
Striding towards the Future Multiple Edits at a Time
 
Wiring Hacker Synapses - Cola: Real-Time Shared Editing
Wiring Hacker Synapses - Cola: Real-Time Shared EditingWiring Hacker Synapses - Cola: Real-Time Shared Editing
Wiring Hacker Synapses - Cola: Real-Time Shared Editing
 

Recently uploaded

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Recently uploaded (20)

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

Casting spells and polymorphism in C

  • 2.
  • 3.     
  • 4. public void castSpell(Spell spell, bool repeat, int timeOutinMs, int rangeInM, bool hitFriendly) {…} public void castSafeSpell(Spell spell, bool repeat, int timeOutinMs, int rangeInM) { castSpell(spell, repeat, timeOutinMs, range, false); } public void castNeverEndingSpell(Spell spell, int rangeInM, bool hitFriendly) { castSpell(spell, true, -1, range, hitFriendly); }
  • 5. public void castSpell(Spell spell, bool repeat = false, int timeOutinMs = -1, int rangeInM = 30, bool hitFriendly = false) Spell frost = new FrostFury(); castSpell(frost); Spell frost = new FrostFury(); castSpell(frost, false);
  • 6. public void castSpell(Spell spell, bool repeat = false, int timeOutinMs = -1, int rangeInM = 30, bool hitFriendly = false)  Spell frost = new FrostFury(); castSpell(frost, rangeInM: 1000);  
  • 7.       List<object> names = new List<string>();
  • 8. HordeSubject Orc Undead Troll
  • 9. HordeSubject player = new Orc(); HordeSubject player = new Undead(); List<HordeSubject> raid = new List<Orc>();
  • 10.
  • 11.
  • 12.    ℤ   ℤ 
  • 13. ∈ℤ        ∈ℤ    ∀ ∈ℤ  
  • 14.   ∀ ∈ℤ  ∀ ∈ℤ      ∀ ∈ℤ  ∀ ∈ℤ 
  • 15.
  • 16.
  • 17.
  • 18. Orc HordeSubject Undead HordeSubject OrcShaman Orc
  • 19.
  • 20.  Orc HordeSubject Orc HordeSubject  Orc HordeSubject Orc HordeSubject
  • 21. List<HordeSubject> raid = new List<Orc>(); raid.Add(new Undead());
  • 23.   out public interface IEnumerable<out T> { IEnumerator<T> GetEnumerator(); } public interface IEnumerator<out T> { T Current { get; } bool MoveNext(); }
  • 24. IComparer<HordeSubject> hordeStat = GetHordeComparer(); IComparer<Orc> orcStat = hordeStat;
  • 25.   in public interface IComparer<in T> { int Compare(T x, T y); }
  • 26.
  • 27.
  • 28.         
  • 29.
  • 30.     
  • 32.
  • 33.          
  • 34.      