TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    Refactoring MustFightBattle

    Scheduled Pinned Locked Moved Development
    21 Posts 3 Posters 3.3k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      Trevan
      last edited by

      I've been working on the offensive subs submerge/withdraw step and discovered that my idea of having a unified valid() check that works for both getNames and execute won't work.

      In the offensive subs submerge/withdraw step, execute shouldn't run if there is a destroyer present. But getNames is called at the beginning of the round and there might be a destroyer present that will die before execute is called. If getNames doesn't return the submerge/withdraw step, then an error will occur.

      I was actually able to trigger this error from the master branch when Submersible Subs is false, Sub Retreat Before Battle is false, and a destroyer is present at the beginning of the round but then is destroyed during the round. If Submersible Subs is true and Sub Retreat Before Battle is false, then this error doesn't occur because it doesn't check for destroyers.

      I'm going to be removing valid() as a public method from the BattleStep interface. Instead, getNames and execute will do their own internal valid check. This check might be the same or different, depending on the step.

      1 Reply Last reply Reply Quote 2

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1
      • 2
      • 2 / 2
      • First post
        Last post
      Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums