The Iupdatehandler,ientitymodifier of Andengine

Source: Internet
Author: User

Andengine for Entity Entities Update handler and entity modifiers, Registerupdatehandler and Registerentitymodifier methods

The internal implementation of this method is to add the iupdatehandler,ientitymodifier that will be registered to the Updatehandlerlist,entitymodifierlist,

While Updatehandlerlist,entitymodifierlist are ArrayList subclasses, the addition of the ArrayList method does not control whether the added variable exists in the list and is added directly to the list

So when we register the Iupdatehandler,ientitymodifier object with the entity, we should not register the same object

For example, every time we get a genie from the sprite pool, we register a Ientitymodifier object for her, but there is no anti-registration of the Ientitymodifier object or Clearentitymodifiers when retrieving the sprite. So that the genie may have more than one modifier, in the Onmanagedupdate function will be called many times those same iupdatehandler or Ientitymodifier objects, which will affect the efficiency, so we can in the Recovery wizard when the anti-registration or clear , you can also check when registering the Iupdatehandler,ientitymodifier object, the Getentitymodifiercount () method will return the number of modifiers in the Entitymodifierlist list.

The Iupdatehandler,ientitymodifier of Andengine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.