﻿// Ensure TypeScript compiler is load for VS versions
// below 2015.
// https://www.microsoft.com/en-us/download/details.aspx?id=48739
// Will need a TypeScript definition file for jQuery
// jquery.d.ts (see NuGet jQuery.TypeScript.DefinedType)
$(function ()
{
    var output: string = "";

    function DisplayLine(text: string): void
    {
        output = output + text + "<br/>";
    }

    // Using polymorphism
    var animals: Animal[] = [];

    animals.push(new Horse("Apache"));
    animals.push(new Snake("Sam"));
    for (var i in animals)
    {
        DisplayLine(animals[i].MakeNoise() + " I am " + animals[i].Name);
        DisplayLine(animals[i].Move(45));
    }

    document.body.innerHTML = output;
});  